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

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
面向对象的思维过程是一种解决问题和设计软件的方法,它将现实世界的概念和问题转化为计算机程序设计的模型。这种思维过程的核心是将问题划分为对象,并基于这些对象的特性和行为来构建软件。 首先,面向对象的思维过程强调用对象来表示现实世界中的个体或事物。每个对象有自己的属性和方法。属性描述了对象的特征,方法则定义了对象的行为。通过将问题分解为对象,我们可以更好地理解和控制问题的复杂性。 其次,面向对象的思维过程注重对象之间的交互。对象可以通过消息传递来与其他对象进行通信和合作。这种交互引入了封装、继承和多态的概念。封装可以隐藏对象的内部实现细节,使得对象能够更加独立地工作。继承可以让一个对象继承另一个对象的属性和方法,从而减少重复编码,提高代码复用性。多态允许不同的对象对同一消息做出不同的响应,提供了更大的灵活性和可扩展性。 最后,面向对象的思维过程鼓励模块化和抽象化。通过将对象组织成类和模块,我们可以更好地组织和管理代码。类是一种将相似对象的属性和方法封装在一起的方式。模块是将相关类组织在一起的方式。通过模块化和抽象化,我们可以提高代码的可读性、可重用性和可维护性。 综上所述,面向对象的思维过程是一种将问题转化为对象模型,强调对象之间的交互和模块化的方法。它提供了一种抽象、灵活和可扩展的解决问题的方式,被广泛应用于软件开发领域。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值