文档介绍:软件工程
电子教案
王树林
PART FOUROBJECT-ORIENTED SOFTWARE ENGINEERING
What are the basics concepts and principles that are applicable to object-oriented thinking?
How should object-oriented software projects be planned and managed?
What is object-oriented analysis and how do its various models enable a software engineer to understand classes ,their relations and behaviors?
What is a ‘use case’ and how can it be applied to analyze the requirements of a system?
Chapter 19 OBJECT-ORIENTED CONCEPTS AND PRINCIPLES
WE LIVE IN A WORLD OF OBJECTS.
面向对象的概念和原则
面向对象的分析
面向对象的测试
面向对象系统的技术度量
面向对象的软件工程
面向对象的软件工程
面向对象的范型(Paradigm)
范型又称为开发模式、范例、风范或模式(Pattern)。范型定义了
特定问题和应用的开发过程中将遵循的步骤;
确定将用于表示问题和解的那些成分的类型;
利用这些成分表示与问题解决有关的抽象;
直接得到问题的结构。
范型的选择影响到整个软件开发生存期。就是说,它支配了
设计方法
编码语言
测试和检验技术
类和对象
属性
操作、方法+和服务
消息
封装、继承和多态
面向对象的概念
Coad和Yourdon给出了一个定义:“面向对象=对象+类+继承+通信”。
如果一个软件系统是使用这样 4 个概念设计和实现的,则我们认为这个软件系统是面向对象的。
一个面向对象的程序的每一成份应是对象,计算是通过新的对象的建立和对象之间的通信来执行的。
面向对象(Object-oriented)
对象(object)
对象是面向对象开发模式的基本成份。
每个对象可用它本身的一组属性和它可以执行的一组操作来定义。
属性一般只能通过执行对象的操作来改变。
操作又称为方法或服务,它描述了对象执行的功能,若通过消息传递,还可以为其它对象使用。
对象继承类的
所有属性和操作
对象:chair
cost
dimensions
weight
location
color
buy
sell
weigh
move
类:Furniture
cost
dimensions
weight
location
color
buy
sell
weigh
move
对象:chable
cost
dimensions
weight
location
color
buy
sell
weigh
move