做Use Case时如何描述算法?
假设我正在为具有评分系统的游戏制作一个用例
。您在游戏中所做的每个动作都会增加/减少您在游戏中的分数。
这是我的用例
的草图:
1. ...
2. ...
...
8. The Player makes (some move).
9. The System registers the play and calculates his new score.
计算这个新分数背后有一些算法。我应该在这个用例
中说明它吗?我应该在另一个用例
中陈述它吗?我应该简单地省略算法实现的细节吗?
用例
是陈述这些事情的正确位置吗?或者用例
是否应该只关心玩家
和系统
(游戏
)之间的交互?
我想说我可能想在某个地方写下这些细节(如果不仅仅是为了确保我真的理解它们)。所以在我看来,也许最好的选择是制作另一个用例,我在其中描述它们是如何工作的?
通常如何使用用例
来完成这些事情?谢谢
Let's say I'm making an Use Case
for a game that has a scoring system. Each action you do in the game will increase/decrease your score in the game.
Here is a sketch of my Use Case
:
1. ...
2. ...
...
8. The Player makes (some move).
9. The System registers the play and calculates his new score.
There is some algorithm behind calculating this new score. Should I state it in this Use Case
? Should I state it in another Use Case
? Should I simply omit the details of implementation of the algorithm?
Is the Use Case
the correct place to state those kinds of things? Or should the Use Case
just be concerned with the interactions between the Player
and the System
(the Game
)?
I'd say I'd probably want to write down those details somewhere (if not just to make sure I really do understand them). So it looks to me maybe the best option is to make another Use Case where I describe how they work?
How are generally these kind of things done with Use Cases
? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
算法不是用户和系统之间创造有价值的东西的交互。
它们是用例的脚注或附录。
它们通常很重要,但它们不是互动。因此将它们放在附录中。
还。所有用例均由参与者发起。他们的演员想要玩他们的游戏;他们发起事情。系统通常无法发起行动——它是被动的,对参与者做出响应。
Algorithms are not interaction between user and system to create something of value.
They're a footnote or an appendix to the use case.
They're often important, but they're not interaction. Hence putting them in an appendix.
Also. All use cases are initiated by the Actor. They actor wants to play they game; they initiate things. The system generally can't initiate action -- it's passive, responding to the actor.
算法不属于用例。将它们提取到业务规则部分或文档中。
Algorithms don't belong in use cases. Extract them to a business rules section or document.
我建议您使用活动图来表示算法,并在这种情况下让您的用例步骤保持简单。
我也同意“Johann Strydom”的立场。
狮子座
I suggest you to use Activity Diagram to represent algorithms and leave your Use Case steps simple in this case.
I also agree with "Johann Strydom" in his position.
Leo