1 / 55
文档名称:

威廉勃特勒叶芝Willia.ppt

格式:ppt   大小:552KB   页数:55页
下载后只包含 1 个 PPT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

威廉勃特勒叶芝Willia.ppt

上传人:1485173816 2022/2/25 文件大小:552 KB

下载得到文件列表

威廉勃特勒叶芝Willia.ppt

相关文档

文档介绍

文档介绍:威廉勃特勒叶芝Willia
摘要
软件构造:从面向过程到面向对象
如何规约对象?--抽象!
Abstract Data Type Specification
形式?
质量?
ADT与软件开发
2022/2/26
2
Inshe relations and commonalities between object types.
How to use object types to structure programs.
14
对象刻画
Consider not a single object but a type of objects with similar properties.
Define each type of objects not by the objects’ physical representation but by their behavior: the services (FEATURES) they offer to the rest of the world.
External, not internal view: ABSTRACT DATA TYPES
15
对象刻画问题
The main issue: How to describe program objects (data structures):
Completely
Unambiguously
Without overspecifying?
(Remember information hiding)
2022/2/26
16
Institute of Computer Software
Nanjing University
A stack, concrete object
count
representation
(array_up)
capacity
representation [count] := x
free
(array_down)
1
representation
n
new
(linked)
item
item
previous
item
previous
previous
“Push” operation:
count := count + 1
representation [free] := x
“Push” operation:
free := free - 1
new (n)
:= x
“Push” operation:
:= last
head := n
17
A stack, concrete object
count
representation
(array_up)
capacity
representation [count] := x
free
(array_down)
1
representation
n
new
(linked)
item
item
previous
item
previous
previous
“Push” operation:
count := count + 1
representation [free] := x
“Push” operation:
free := free - 1
new (n)
:= x
“Push” operation:
:= last
head := n
18
抽象数据类型
一种数学的刻画方式
“类型”? -- (Data type, 简称Type)

操作 函数
规律 公理
2022/2/26
19
Institute of Computer Software
Nanjing University
Stack: An abstract data type
Types:
STACK [G] -- G: Formal generic parameter
Functions (Operations):
put: STACK [G]  G  STACK [G]
remove: STACK [G]  STACK [G]
item: STACK [G]  G
empty: STACK [G]  BOOLEAN
new: STACK [G]
2