扩展

假设您正在查看UML图的6种基本类型(来自UML 2.0样式的元素)

  1. 班级图
  2. 用例图
  3. 状态机图
  4. 活动图
  5. 序列图
  6. 物理图

假装自己疯了,您喜欢为系统绘制所有6个图表。

您会从哪个开始?那你会去哪个?如果您有一个,请访问每个图的最佳顺序是什么 很清楚 您希望系统做什么的想法?

我认为您应该从物理图开始,然后努力进行课堂图。我总是说..?我错了吗?

有帮助吗?

解决方案

用例 是定义“什么”系统的主要功能 , ,随后是状态机和活动图(可以看出这两种方式 - 通常,活动图更多地是关于“什么”和状态机器更多关于“如何”的信息,但是我已经看到了每个人的反例);阶级和序列图,甚至更多的组件和部署(统称为“物理”),越来越多地关于 如何 您的系统会做到的。我肯定会从“什么”转向“如何”作为反向序列没有意义 - 如果您还没有定义“什么”,那么“怎么有意义?

因此,大致总结:用例,活动,状态机,类,序列,组件,部署。该顺序是有道理的,因为它更深入地朝着实施方面而远离分析方面,因此,例如,有兴趣确切了解您将迎合哪些用例以及您将适用哪些业务规则(活动图)可能停止“阅读” “比需要了解您部署策略的完整详细逻辑的人早。

其他提示

类,序列和用户图图表示项目中通常创建的图的90%以上。班级图本身有时比所有其他图都代表更多的图。

最好的解决方案是保持简单并将建模调整到团队的水平上。

如果没有UML经验 然后,只需创建类图即可表示应用程序的骨架。

如果初学者 级别然后以用户酶,序列和类图开始。

如果中等水平 然后使用所有图表,因为每个图涵盖了另一个视图,这并非总是可以使用Java代码的视图。我的意思是Java仅与类和序列图有关。

Physical diagram is probably as good a place to start as any. I find activity diagrams really helpful in working out the kinks in a design, and sequences are good for much the same reason. I've rarely bothered with state machine diagrams.

I think realistically you're going to want to revisit whatever design you do first anyway (iterated design, woo!) so it's probably worth starting with whatever is going to bring the most clarity to your project.

UML diagrams are depictions of various models of a design. I am not sure that they can be cleanly serialized the way you describe. Frequently a class diagram is used in both the analysis and design phases of a process. Similarly other diagrams are used in multiple phases.

It depends on which aspect of a design you are interested in at any point in time you use the appropriate diagram to "view" a model of the design.

I have seen both "start with class diagram" and "start with use case model" proposed. I have come to realize that it really does not matter.

I think you want to start with the high level behaviour of the system using several diagrams then gradually work your way down to more detailed design using the same set of diagrams.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top