我对在哪里描述我可能在应用程序的某些部分中使用的算法感到有点困惑。
假设我想创建一个Use Case
描述User
输入一组值的方式,并且我的应用程序返回这些值的平均值(当然,这是一个非常简单的情况,但这样更容易解释)。
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.
现在,我应该在哪里说明计算数字平均值的算法?
如果我不得不更改游戏的配置、进入下一个级别、在给定一组条件的情况下将用户添加到数据库等,而不是计算数字的平均值,该怎么办?
我觉得我需要以某种方式将我对该领域的知识形式化,否则我可能会忘记它,或者更糟糕的是,假设我知道只有写下来才能理解的事情。
在其他线程,主题中,有人谈到了业务规则。从我读过的内容来看,它们似乎是作为类图上的小注释。也许我错了?如果这就是它们,我发现它们太麻烦了,无法用于更复杂的算法。
谢谢