做Use Case时如何描述算法?

发布于 2024-09-10 08:21:17 字数 580 浏览 10 评论 0原文

假设我正在为具有评分系统的游戏制作一个用例。您在游戏中所做的每个动作都会增加/减少您在游戏中的分数。

这是我的用例的草图:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

温柔女人霸气范 2024-09-17 08:21:17

算法不是用户和系统之间创造有价值的东西的交互。

它们是用例的脚注或附录。

它们通常很重要,但它们不是互动。因此将它们放在附录中。


还。所有用例均由参与者发起。他们的演员想要玩他们的游戏;他们发起事情。系统通常无法发起行动——它是被动的,对参与者做出响应。

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.

紅太極 2024-09-17 08:21:17

算法不属于用例。将它们提取到业务规则部分或文档中。

Algorithms don't belong in use cases. Extract them to a business rules section or document.

嘿嘿嘿 2024-09-17 08:21:17

我建议您使用活动图来表示算法,并在这种情况下让您的用例步骤保持简单。
我也同意“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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文