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.
发布评论
评论(1)
需求是代码需要做什么。设计涉及如何做到这一点,包括类层次结构、使用的设计模式等。
要求:
设计:
我并不是说这就是实际的设计,而是说设计应该如何分析需求并最终成为有效的实现。
Requirements is what the code needs to do. Design gets into how it will do it, with class hierarchies, design patterns used, etc.
Requirements:
Design:
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.