UML类图中的Java服务器页面(.JSP)文件 [英] Java Server Pages (.JSP) files in UML Class Diagrams

查看:210
本文介绍了UML类图中的Java服务器页面(.JSP)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为即将进行的项目编写设计,我想知道如何在已创建的UML类图中表示视图(jsp文件).由于jsp文件不是类,因此它们适合这里吗?我想不是,因为这是一个类图,但是我不确定我还应该如何代表这些想法?

I am writing up a design for a project I am about to embark on and I am wondering how I should be representing the view (the jsp files) in the UML class diagrams I have created. Since jsp files aren't classes do they fit in here? I'd think not since this is a class diagram but I'm not sure how else I should be representing these, any ideas?

推荐答案

所有取决于您使用UML的上下文.

All depends on the context in which you are using UML.

提炼的UML 中,马丁·福勒(Martin Fowler)区分了三种使用UML的方法:

In UML distilled, Martin Fowler distinguishes three ways of using UML:

  • 蓝图(在软件开发过程中使用UML)
  • 素描(UML用于系统的详细信息)
  • 可执行UML(使用UML,其中UML是代码之前的程序的持久源)

出于逻辑原因,大多数软件开发过程(蓝图模式)不允许您将视图组件包括在类图中:UML与 user1556242 所说的.

Most software development processes (blueprint mode) won't allow you to include view components in your class diagram for logical reasons: UML is about OOP. This is also the case in executable UML, in other words this is what user1556242 said.

在蓝图或可执行UML模式下,允许在其中表示视图组件的唯一UML图是组件图部署图:这些图未显示特定于对象的功能.

In blueprint or executable UML modes, the only UML diagrams on which view components are allowed to be represented in are the component diagram and the the deployment diagram: these diagram don't show object-specific features.

但是,如果您处于草图模式,则这是在图表中包括JSP页面的合法权利,但这不应该是视图组件形式.在类图中,您应该表示类.您不应代表JSP页面本身,而应代表其对象形式.在Tomcat中,可以在运行时将JSP转换为servlet类(请参见 Wikipedia文章).通过 Jasper 完成.

However, If you are in sketch mode, this is your legitimate right to include JSP pages in your diagram, but this should not be the view component form. In a class diagram you should represent classes. You should not represent the JSP page itself but its object form. A JSP is translated into a servlet class at runtime (see the Wikipedia article), in Tomcat this is done via Jasper.

这篇关于UML类图中的Java服务器页面(.JSP)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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