Chapter 13 模块化与信息隐藏
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Easy to implement and change
Problems solving is hardest when all aspects of the problems must be considered simultaneously
Modularization
Modules can be treated “independently”
2. Information Hiding: “On the criteria to be used in decomposing systems into modules”
Modules Communications
Relationships of Modules: Connections
A connection is a reference to some label or address defined elsewhere
General considerations
Simplicity
Reduced debugging and modification time By divided the system into separate pieces
Each pieces can be considered, implemented, fixed, and changed with minimal consideration or effect on the other pieces
How complicated the connection is Whether the connection refers to the module itself or
something inside it What is being sent or received
How complicated the connection is
Error and change in one module can propagate to every others Comprehension one module needs helps of every others More different to reuse
Cohesion
Maximizing relationships among elements in the same module
Main Contents
1. Basics of Modularity: “Structured Design”
1. Motivation 2. Coupling 3. Cohesion 4. Soቤተ መጻሕፍቲ ባይዱe Excises
easier to isolate failures change in one module doesn’t affect other modules,
limit “ripple effect”
Problems and Difficulties
When dividing a program into pieces, increasing the complexity because :
the amount of over-lapped code and other interrelationships that usually exist
Interrelationships mean dependences
Methods
Coupling
Minimizing the relationships among modules
Observability
“Obviously Correct” programs: The ability to easily perceive how and why actions occur
Reduced development and change time
Module
A set of on or more contiguous program statements having a name by which other parts of system can invoke it.
《计算与软件工程II 》
Ch13 模块化与信息隐藏
丁二玉 南京大学软件学院
Main Contents
1. Basics of Modularity: “Structured Design”
1. Motivation 2. Coupling 3. Cohesion 4. Some Excises
2. Information Hiding: “On the criteria to be used in decomposing systems into modules”
can understand each module in isolation can use (or reuse) each module in isolation can build each module in isolation failure in one module doesn’t affect other modules, so
Connection of a module
To Common environments
General, Scoped
To other module
Connection to Common environments: Common Coupling
A connection couple every module sharing it to every other such module
More connections, more relationships More complex connections, More complex
relationships
How many kinds of connections?
Complexity and Coupling
Coupling is the measure of the strength of association established by a connection from one module to another
Problems solving is hardest when all aspects of the problems must be considered simultaneously
Modularization
Modules can be treated “independently”
2. Information Hiding: “On the criteria to be used in decomposing systems into modules”
Modules Communications
Relationships of Modules: Connections
A connection is a reference to some label or address defined elsewhere
General considerations
Simplicity
Reduced debugging and modification time By divided the system into separate pieces
Each pieces can be considered, implemented, fixed, and changed with minimal consideration or effect on the other pieces
How complicated the connection is Whether the connection refers to the module itself or
something inside it What is being sent or received
How complicated the connection is
Error and change in one module can propagate to every others Comprehension one module needs helps of every others More different to reuse
Cohesion
Maximizing relationships among elements in the same module
Main Contents
1. Basics of Modularity: “Structured Design”
1. Motivation 2. Coupling 3. Cohesion 4. Soቤተ መጻሕፍቲ ባይዱe Excises
easier to isolate failures change in one module doesn’t affect other modules,
limit “ripple effect”
Problems and Difficulties
When dividing a program into pieces, increasing the complexity because :
the amount of over-lapped code and other interrelationships that usually exist
Interrelationships mean dependences
Methods
Coupling
Minimizing the relationships among modules
Observability
“Obviously Correct” programs: The ability to easily perceive how and why actions occur
Reduced development and change time
Module
A set of on or more contiguous program statements having a name by which other parts of system can invoke it.
《计算与软件工程II 》
Ch13 模块化与信息隐藏
丁二玉 南京大学软件学院
Main Contents
1. Basics of Modularity: “Structured Design”
1. Motivation 2. Coupling 3. Cohesion 4. Some Excises
2. Information Hiding: “On the criteria to be used in decomposing systems into modules”
can understand each module in isolation can use (or reuse) each module in isolation can build each module in isolation failure in one module doesn’t affect other modules, so
Connection of a module
To Common environments
General, Scoped
To other module
Connection to Common environments: Common Coupling
A connection couple every module sharing it to every other such module
More connections, more relationships More complex connections, More complex
relationships
How many kinds of connections?
Complexity and Coupling
Coupling is the measure of the strength of association established by a connection from one module to another