Java - 学习 MVC [英] Java - Learning MVC

查看:26
本文介绍了Java - 学习 MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习如何将 MVC 架构应用到我的 Java 项目中;主要是我在 Swing 的工作.除了我在这里找到的这两个之外,现在没有简单的解释或示例如何使用 MVC 编写正确的代码:

I wish to learn how to apply MVC architecture to my Java project; mainly my work in Swing. Now there is no easy explanation or example how to write proper code using MVC in mind apart from these two I found here:

  1. http://leepoint.net/notes-java/GUI/structure/40mvc.html
  2. http://www.oracle.com/technetwork/articles/javase/mvc-136693.html

在我看来,Java 中没有定义的 MVC 架构.根据我的观察,Java 为您提供了 Wwing 基础级别的内容,您可以自行应用的内容在第一个教程中.

It seems to me there is not a defined MVC architecture in Java. From what I looked at it's what Java offers you at the base level of Wwing and what you can apply on your own is in the first tutorial.

除了上述两个资源之外,有人可以向我提供可以让您轻松使用 Java MVC 的资源吗?也许是视频教程?

Apart from the two resources above, can someone provide me with a source that can ease you in to Java MVC? A video tutorial maybe?

推荐答案

这是一个很好的例子 http://www.leepoint.net/GUI/structure/40mvc.html 我试图找到最简单的方法让你感受这个想法.

Here is pretty nice example http://www.leepoint.net/GUI/structure/40mvc.html I tried to find simplest possible to let you feel the idea.

反正我不喜欢:

在我看来,Java 中没有定义的 MVC 架构.

Seems to me there is not a defined MVC architecture in Java.

您可以使用各种不同语言的 MVC、MVP 和其他模式.Java 与 MVC 无关,只是 MVC 设计可以用 Java 编码.然而,有一些框架嵌入了 MVC 架构并强制使用它.Spring MVC 是最著名的 - 尝试查找有关它的更多信息,也许是一些教程.

You can use MVC, MVP and whole other patterns in various different languages. Java has nothing to do with MVC, except MVC design can be coded in Java. There are, however, some frameworks that have embedded MVC architecture and forces using it. Spring MVC is the most known - try to find more about it, maybe some tutorials.

这篇关于Java - 学习 MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆