类图从用例图 [英] Class diagram from use case diagram

查看:1637
本文介绍了类图从用例图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下用例图





从这个图中创建类的最好方法是什么?



尝试创建两个主类( UserManager ContentManager ),但整个类结构看起来错误和不合逻辑。

任何人都可以提供一个简单的例子来帮助我?



下面我粘贴了我的类图。



解决方案

A 事物从问题域,不是任意桶的代码。例如,您应该有类注释文章公告 Advertisement 。您应该在相关类之间具有关联,每个关联具有命名属性和多重性。结果应类似于此< a>。你最终会给每个班级的责任。



Manager 结尾的类名表示您正在进行它错了。


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?

解决方案

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.

这篇关于类图从用例图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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