首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 系统运维 >

Can a system be an actor in a use case

2012-12-19 
Can a system be an actor in a use case?I agree that use cases are not always the best way to try to

Can a system be an actor in a use case?


I agree that use cases are not always the best way to try to represent requirements. For real-time systems involving hardware devices, for example, an event-response table is often a better way to describe the system's behavior than trying to force-fit everything into a use case. Different kinds of nails need different kinds of hammers. Postconditions are evil. Any postconditions must show up in some use case (possibly as preconditions), otherwise there's no way to know whether they've been met. Anything else is sneaking design into the requirements.

One of the questions you need to keep asking is "is this really the requirement, or is it a presumed realization?" Leave design to the developers.

?

---

发信人:?bakkhos?(笨瓶子·喜欢乌咪·代替月亮惩罚你~:),?信区:?SoftEng???????
标??题:?定时器在用例图里是不是一个角色?
发信站:?BBS?水木清华站?(Sun?Aug?12?00:37:37?2001)

摘自《非程序员》第一期

定时器在用例图里是不是一个角色?
Straybird:
假设一个用例是“查询设备状态”,角色是“设备”,每隔一定时间系统开始执行“查
询设备状态”这个用例。但是用例应由角色启动的,而“设备”这个角色只是被动的,
这个用例实际上是定时器启动的,定时器应当是角色。可是定时器是系统边界以内的对
象,不应是角色。是不是可以把时间看作角色,定时器作为对应角色的主动对象,这样
理解是不是就符合模型了?
刚开始学习用UML?做分析,许多地方不知理解的对不对,希望大家答疑解惑
worship:
我觉得定时器应是一个守卫条件,不应该看为一个角色。“查询设备状态”用例由其他
角色激活,然后启动计时器"守卫"对被动角色“设备”的访问。
Ms.OO:
角色应该是时间。角色有几类:用户,外系统,时间,所以,角色应该是时间。
“是否角色”与“是否在系统内表示”并无关联,例如,一个顾客上网站买东西,顾客
是角色,但系统内也会有“顾客”类。
角色是角色,它在系统外部工作,它可以映射系统内的某个类,也可以什么也不是
straybird:
多谢两位指点。从状态图上理解,把定时器作为守卫条件就很合理了,这样启动系统时
,用例激活,守卫条件满足时,执行用例,启动系统的操作员是激活用户的角色,是这
样吗?把时间作为角色也应该是合理的,只是这个角色有点抽象,呵呵。


--
有人认为:“解决问题的高手是天生的,而不是后天造就的。有些人拥有此技能,有些
人则没有。它是一项天生的创造性的技能…是教不会的。”
但事实上,成功解决问题很大程度上取决于系统的和受过训练的思考方式,这种技能能
被任何一个有天赋的人所掌握。结构化的方法会促进灵感和创造力-而不是阻碍它。


※?来源:·BBS?水木清华站?smth.org·[FROM:?166.111.166.223]

热点排行