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

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

问题描述

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


  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的基础上提供的,您可以在第一个教程中应用自己的内容。



除了两个资源以上,有人可以为我提供一个可以轻松使用Java MVC的源码吗?一个视频教程可能?

解决方案

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

无论如何我不喜欢:


似乎我没有Java中定义的MVC架构。


您可以使用各种不同语言的MVC,MVP和其他所有模式。 Java与MVC无关,除了MVC设计可以用Java编码。然而,有一些框架已经嵌入了MVC架构和使用它的力量。 Spring 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

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.

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?

解决方案

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.

Anyway I don't like the:

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

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天全站免登陆