Professional Documents
Culture Documents
Chapter1-Introd To OO Analysis&Design
Chapter1-Introd To OO Analysis&Design
Other References:
Using UML: Software Engineering with Objects and Components, 2nd
Edition, Perdita Stevens, Addison-Wesley, 2000, ISBN 978-0321269676
Physical entity
Chemical Process Truck
Software entity
Linked List
A More Formal Definition
Attributes
Customer class
Encapsulation Illustrated
Professor Clark Ac
ce
pt
needs to be able to
()
Co
s
ur
de
se
ra
teach four classes in O ff e
G
al
rin
in
g(
the next semester. )
i tF
Name: Michael Zheng
Name:
bm
Employee ID: 567138
Su
HireDate: 07/25/1991
Michael
Status: Tenured
Zheng
Se
SetMaxLoad(4) Discipline: Finance
tM
MaxLoad:4
ax
Employee
Lo
ad
()
TakeSabbatical()
22
Modularity
Modularization consists of dividing a program into
modules which can be compiled separately, but which
have connection with other modules
The connections between modules are the
assumptions which the modules make about each
other
Modularity breaks up
complex systems into
small, self-contained
pieces that can be
managed
independently
Modularity
The meaning of modularity as Myers observes is “the act of
partitioning a program into individual components” and
this can reduce its complexity to some degree
Course
Catalog
System
Course Registration
System Student
Management
System
Modularity
Two additional technical issues can affect modularization
decisions
First, since modules usually serve as the elementary and
indivisible units of software that can be reused across
applications, a developer might choose to package classes
and objects into modules in a way that makes their reuse
convenient
Second, many compilers generate object code in segments,
one for each modules. Therefore, there may be practical
limits on the size of individual modules
26
Hierarchy
Set of abstractions forms a hierarchy and by identifying
hierarchies, we simplify the understanding of our problem
Hierarchy is a ranking or ordering of abstractions
Increasing
abstraction
Vehicle
Car
Ford
Decreasing
abstraction
Mustang Taurus Thunderbird
Elements at the same level of the hierarchy should be at the same level of abstraction
Hierarchy
Abstraction is a good thing, but in all except the work
trivial applications, we may find many more
abstractions than we can comprehend at one time
Encapsulation helps manage this complexity by
hiding the inside view of our abstractions
Modularity helps also, by giving us a way to cluster
logically related abstractions
Still, this is not enough, so ranking of abstraction
helps
28
Hierarchy
A set of abstractions often forms a hierarchy, and by
identifying these hierarchies in our design, we greatly
simplify our understanding of the problem
29