Class diagram from use case diagram

送分小仙女□ 提交于 2019-12-25 07:09:53

问题


I have the following use case diagram

What is the best way to create a class from this diagram?

I've tried creating two main classes (UserManager and ContentManager) but the whole class structure looks wrong and illogical.

Can anyone provide a simple example to help me?

[Edit] Below I've pasted my class diagram. What would you change or what do you think about it?


回答1:


A Class represents a set of things from the problem domain, not an arbitrary bucket of code. For example, you should have classes like Comment, Article, Announcement, and Advertisement. You should have associations between pairs of related classes, each association having named properties and multiplicities. The result should look like this. You will eventually give each of those classes responsibilities. That is how object oriented analysis and design works.

Class names ending in the word Manager indicate you're doing it wrong.



来源:https://stackoverflow.com/questions/35797303/class-diagram-from-use-case-diagram

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!