MVC 建模 + JSP 与 UML
我是 Java Server Pages (JSP) 的新手,但我非常习惯统一建模语言 (UML)。
我想开始开发一个使用设计模式模型-视图-控制器(MVC)的Web应用程序。
例如,我想为 MVC + JSP 教程。
本教程构建了一个简单的应用程序,正如作者所描述的,它是一个“Web 应用程序是一个咖啡顾问,用户将输入咖啡的类型和得到一些建议”
通过适当的 UML 架构,我的意思是序列图、类图、包图等。
我应该如何进行?
I am new to Java Server Pages (JSP) but I am pretty used to Unified Modeling Language (UML).
I want to start to develop a Web Application that uses the Design Pattern Model–view–controller (MVC).
For instance I want to build the adequate UML architecture for the example given on this MVC + JSP Tutorial.
This Tutorial builds a simple application and as the author describes, it is a "web application is a Coffee advisor, the user will input the type of Coffee and get back some advise"
By adequate UML architecture, I mean Sequence Diagrams, Class Diagram, Package Diagrams etc.
How should I proceed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题似乎脱离了主题,因为不幸的是 UML 总是与模型驱动开发相关联。
我的意思是,如果您在类图中使用持久性注释,它将生成包括 Hibernate 注释的代码,然后从代码中生成数据库,那么 UML 可以处理 MVC 而不仅仅是 MDD。
这很奇怪,但我更喜欢 MVC 而不是 MDD,因为这更现实,并且在编码和部署级别节省大量时间。如果您需要在交付和需求更改之间进行多次迭代,这也更好。
你有很多允许 ORM 的工具,但我认为只有 Omondo 在对象级别研究了使用 ORM 的 UML,而不是其他更面向 MDD 的工具。我的意思是使用代码生成从模型生成数据库,而 Omondo 仅使用 Hibernate 注释,然后让 Hibernate 创建数据库。我更喜欢使用 UML 和 Hibernate 而不是 MDD 来生成数据库,因为使用 MDD 时,一旦生成了数据库,就无法手动更改代码。一切都应该在模型级别完成。这限制太多,有时甚至是不可能的。 Omondo 和 Hibernate 允许我根据需要多次更改代码。
This question could seem out of topic because UML is unfortunately always associated to Model Driven Development.
I mean that if you use Persistence annotations in your class diagram which would generate the code including Hibernate annotation and then the database from the code then UML can deal with MVC and not only with MDD.
This is strange but I prefer MVC to MDD because this is more realistic and save a lot of time at coding and deployment level. This is also better if you need multiple iterations between deliveries and requirement changes.
You have many tools which allows ORM but I think only Omondo has investigated the UML with ORM at object level oppose to the other tools more MDD oriented. I mean generate a database from a model using code generation while Omondo is only using Hibernate annotations and then let Hibernate to create the database. I prefer to use UML and Hibernate and not MDD to generate my Database because when using MDD once you have generated your database you can not change the code manually. Everything should be done at model level. This is too much constraints and sometimes impossible. Omondo and Hibernate allows me to change my code as many times as needed.