我有点困惑在应用程序的某些部分描述算法的位置。
假设我想创建一个用例
,描述用户
输入一组值,我的应用程序返回这些值的平均值(当然,这是一个非常简单的情况,但这样更容易解释)。
1. The User tells the System he wants to calculate the average of a set of numbers.
2. The System asks the User for a number.
3. The User tells the System a number.
Repeat steps 2-3 until the User tells the System there are no more numbers left.
4. The System returns the average of all those numbers.
现在,我应该在哪里说明计算数字平均值的算法?
如果不是计算数字平均值,而是需要更改游戏配置、进入下一级别、根据一组条件向数据库添加用户等,怎么办?
我觉得我需要以某种方式正式化我对领域的知识,否则我可能会忘记它,甚至更糟糕的是,认为我知道的东西只有通过写下来才能理解我不知道。
在其他线程或主题中,有人谈到业务规则。从我所了解的内容来看,它们似乎被放置在类图上的小笔记中。也许我错了?如果是这样,我觉得它们对于更复杂的算法来说太麻烦了。
谢谢