建立功能需求 - 详细程度

发布于 2024-10-04 13:24:43 字数 1436 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

被翻牌 2024-10-11 13:24:43

您在功能需求和设计方面之间的界限在哪里?

需求是代码需要做什么。设计涉及如何做到这一点,包括类层次结构、使用的设计模式等。

要求:

必须有 A、B、C 类型
用户。 A 型只能编辑
自己的账号,输入B即可编辑
他们自己的帐户并发布到隐藏
论坛,C型可以编辑所有账号
并发布到所有论坛。应用程序必须具有较小的内存占用,因为等等等等......

设计:

用户类的每个实例都会
包含一个成员变量a
权限对象。权限
对象是位字段的包装
因为内存紧张,但是有
几种方便的方法,称为
foo、bar 和 baz。 foo 执行 XXX 并且是
公开,(最终设计变得非常低水平并被转向
到代码中)。

我并不是说这就是实际的设计,而是说设计应该如何分析需求并最终成为有效的实现。

Where do you draw the line between functional requirements and aspects of design?

Requirements is what the code needs to do. Design gets into how it will do it, with class hierarchies, design patterns used, etc.

Requirements:

There must be A, B, and C types of
user. Type A is only able to edit
their own account, type B can edit
their own account and post to hidden
forums, type C can edit all accounts
and post to all forums. The application must have a small memory footprint because blah blah blah....

Design:

Each instance of the user class will
contain a member variable of a
permissions object. The permissions
object is a wrapper for a bit field
because memory is tight, but has
several convenience methods, called
foo, bar, and baz. foo does XXX and is
public, (eventually design gets very low level and is turned
into code).

I'm not saying that would be the actual design, but that's how the design should analyze the requirements and eventually become a working implementation.

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