6 Designing with Objects
Youhave to pay attention to the overall design and invest the proper amount oftime and effort to create the best possible product.Design Guidelines
Manyorganizations do not follow a standard software development process.The mostimportant factor in creating a good design is to find a process that you andyour organization can feel comfortable with.
Creating a high-level modelthat describes the system to be built.
As you know, UML is not a design process, but a modeling tool.
The Ongoing Design Process
Design methodologies:waterfall model(瀑布模型)
Inpractice, the waterfall model has been found to be unrealistic.
Rapid prototyping(快速原型机制造)
Safety Versus Economics
Software Engineering
Performing the Proper Analysis
分析阶段
Developing a Statement of Work
制定工作说明书(SOW)
Gathering the Requirements
Whereasthe SOW is a document written in paragraph (even narrative) form, therequirements
are usually represented as asummary statement or presented as bulleted items.
Developing a Prototype of the User Interface
Most prototypes are created with anintegrated development environment (IDE).
Identifying the Classes
Take advantageof the fact that the design is an iterative process.
Determining the Responsibilities of Each Class
Determining How the Classes Collaborate with Each Other
Although a classmust fulfill certain responsibilities, many times it will have to interact withanother class to get something it wants.
Creating a Class Model to Describe the System
UML
Case Study: A Blackjack Example
Using CRC Cards
One of the most popular methods foridentifying and categorizing classes is to useclass-responsibility-collaboration cards (CRC).
Identifying the Blackjack Classes
Dealer 庄家
Deck 桌面
The dealer couldbe a specific type of player and perhaps inherit from a player class.
Identifying the Classes’ Responsibilities
Joker 王(纸牌)
UML Use-Cases(用例): Identifying theCollaborations
First Pass at CRC Cards
UML Class Diagrams: The Object Model
Prototyping the User Interface
develop the user interfaceprototype,
Conclusion
Combining several classes to build a system
UML class diagram represents this system.