《The Object-Oriented Thought Process》读书笔记3

本文探讨了软件设计过程中的关键步骤,包括需求分析、原型设计、类识别及职责分配等内容。通过一个具体的21点游戏案例,详细介绍了如何使用CRC卡片来辅助识别类及其责任,并展示了UML类图在系统建模中的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值