从用例描述中抽取的类图

时间:2016-04-05 16:23:08

标签: uml

我知道我可以从数据库E-R Diagram构建一个类图(表成为类,表属​​性是类属性......)

但我正在寻找信息(或一步一步)从用例描述(甚至序列图)创建类图。

(现在我发现,序列图对象变成了类,刺激消息是方法)

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

I used to TA in software engineering, and both create a class diagram from a textual definition as well as create a class diagram from a sequence diagram were regular exam questions.

Creating class diagrams from a specification should be covered in your lectures since its one of the most important things to learn. This site explains the workflow quite well in my opinion.

It is important to note, that in software engineering there never is just one solution. You can tackle problems in multiple ways each with their own benefits and problems. The most important step to learning is doing it yourself, just looking at solutions won't help you.

For creating class diagrams from a sequence diagram: Objects are instance of classes, in most sequence diagrams there is only one instance of any given class. Therefore "objects become classes" is not technically correct but the right intention. Messages represent method calls on the receiving object, ergo you need to add these methods to the class of the receiving object.

Any communicating classes need to be associated, else they could not call their methods.

We put focus on only modelling the information you can derive from the sequence diagram, e.g. in most cases you do not know multiplicities of associations.