本文介绍了类图从用例图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有以下用例图 从这个图中创建类的最好方法是什么? 尝试创建两个主类( UserManager 和 ContentManager ),但整个类结构看起来错误和不合逻辑。 任何人都可以提供一个简单的例子来帮助我? 下面我粘贴了我的类图。 解决方案 A 类事物从问题域,不是任意桶的代码。例如,您应该有类注释,文章,公告和 Advertisement 。您应该在相关类之间具有关联,每个关联具有命名属性和多重性。结果应类似于此。你最终会给每个班级的责任。 以 Manager 结尾的类名表示您正在进行它错了。 I have the following use case diagramWhat 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? 解决方案 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. 这篇关于类图从用例图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 05:21