Object Oriented - Chapter1 Revised
Object Oriented - Chapter1 Revised
Object Oriented - Chapter1 Revised
Grady Booch
Robert A. Maksimchuk
Concepts
• In the early days of object technology, many people were initially
introduced to “OO” through programming languages.
• As time passed, languages improved, development techniques
evolved, best practices emerged, and formal object-oriented
methodologies were created.
• And, Today object-oriented development is a rich and powerful
development model.
• This section takes a step back to look at the supporting theory that
supplies the foundation for all of the above and provides insight into
why things work the way they do in the object-oriented paradigm.
3
Chapter 1: Complexity
• A physician, a civil engineer, and a computer scientist were arguing
about what was the oldest profession in the world. The physician
remarked,
• “Well, in the Bible, it says that God created Eve from a rib (spine)
taken out of Adam. This clearly required surgery, and so I can rightly
claim that mine is the oldest profession in the world.”
• The civil engineer interrupted, and said, “But even earlier in the book
of Genesis, it states that God created the order of the heavens and the
earth from out of the chaos. This was the first and certainly the most
spectacular application of civil engineering.
• Therefore, fair doctor, you are wrong: mine is the oldest profession in
the world.”
• The computer scientist leaned back in her chair, smiled, and then said
confidently, “Ah, but who do you think created the chaos?”
• Thus computer professionals are one who are responsible to create
chaos (disorder, confusion).
4
Complexity
• These are but a few of the objects in the physical world that involve
truly awesome complexity.
• If we toss a ball into the air, we can reliably predict its path because
we know that under normal conditions, certain laws of physics apply.
• It never happens that in halfway through its flight it suddenly stopped
and shot straight up into the air.
• On the other hand, discrete systems by their very nature have a finite
number of possible states; in large systems, there is a combinatorial
explosion that makes this number very large.
• Each event external to a software system has the potential of placing
that system in a new state, and furthermore, the mapping from state
to state is not always deterministic (away from prediction).
• Hierarchic Structure
• Relative Primitives
• Separation of Concerns
• Common Patterns
• Stable Intermediate Forms
17
Hierarchic Structure
• Frequently, complexity takes the form of a hierarchy, whereby a
complex system is composed of interrelated subsystems that have in
turn their own subsystems, and so on, until some lowest level of
elementary components is reached.
• It is important to realize that the architecture of a complex system is a
function of its components as well as the hierarchic relationships
among these components. As Rechtin observes, "All systems have
subsystems and all systems are parts of larger systems.
System
Subsystem Subsystem
1 2
Relative Primitives
• Regarding the nature of the primitive (simple or basic) (belonging to
an early stage of technical development;) components of a complex
system, our experience suggests that:
Separation of Concerns
• Simon calls hierarchic systems decomposable because they can be
divided into identifiable parts; he calls them nearly decomposable
because their parts are not completely independent. This leads us to
another attribute common to all complex systems:
• Intra-component linkages are generally stronger than inter-
component linkages.
• This difference between intra- and inter-component interactions
provides a clear separation of concerns among the various parts of a
system, making it possible to study each part in relative isolation.
Common Patterns
• Hierarchic systems are usually composed of only a few different kinds
of subsystems in various combinations and arrangements.
• In other words, complex systems have common patterns.
• These patterns may involve the reuse of small components, such as
the cells found in both plants and animals, or of larger structures,
such as vascular systems, also found in both plants and animals.
System
System
Subsystem Subsystem
1 2
Algorithmic Decomposition
• Most of us have been formally trained in the view of top-down
structured design, and so we approach decomposition as a simple
matter of algorithmic decomposition, wherein each module in the
system denotes a major step in some overall process.
• Figure 1–3 is an example of one of the products of structured design, a
structure chart that shows the relationships among various functional
elements of the solution. This particular structure chart illustrates art
of the design of a program that updates the content of a master file. It
was automatically generated from a data flow diagram by an expert
system tool that embodies the rules of structured design
31
Object-Oriented Decomposition
• In Figure 1–4, we have decomposed the system according to the key
abstractions in the problem domain. Rather than decomposing the
problem into steps such as Get formatted update and Add checksum,
we have identified objects such as Master File and Checksum, which
derive directly from the vocabulary of the problem domain.
32
Object-Oriented Decomposition
• Although both designs solve the same problem, they do so in quite
different ways.
• In this second decomposition, we view the world as a set of
autonomous agents that collaborate to perform some higher-level
behavior.
• Get Formatted Update thus does not exist as an independent
algorithm; rather, it is an operation associated with the object File of
Updates. Calling this operation creates another object, Update to
Card.
• In this manner, each object in our solution embodies its own unique
behavior, and each one models some object in the real world. From
this perspective, an object is simply a tangible entity that exhibits
some well-defined behavior.
• Because our decomposition is based on objects and not algorithms, we
call this an object-oriented decomposition.
33
• Clearly, there is no magic, no “silver bullet” that can unfailingly lead the
software engineer down the path from requirements to the implementation of a
complex software system.
• In fact, the design of complex software systems does not lend itself at all to
cookbook approaches.
• Rather, as noted earlier in the fifth attribute of complex systems, the design of
such systems involves an incremental and iterative process.
• Still, sound design methods do bring some much-needed discipline to the
development process.
• The software engineering community has evolved dozens of different design
methodologies.
• Despite their differences, all of these have elements in common. Specifically,
each includes the following:
• ■ Notation The language for expressing each model
• ■ Process The activities leading to the orderly construction of the system’s
models
• ■ Tools The artifacts that eliminate the dullness of model building and enforce
rules about the models themselves, so that errors and inconsistencies can be
exposed.
47
Summary
• Software is inherently complex; the complexity of software systems often
exceeds the human intellectual capacity.
• The task of the software development team is to engineer the illusion of
simplicity.
• Complexity often takes the form of a hierarchy; it is useful to model both the “is
a” and the “part of” hierarchies of a complex system.
• Complex systems generally evolve from stable intermediate forms.
• There are fundamental limiting factors of human cognition; we can address
these constraints through the use of decomposition, abstraction, and hierarchy.
• Complex systems can be viewed by focusing on either things or processes; there
are compelling reasons for applying object-oriented decomposition, in which
we view the world as a meaningful collection of objects that collaborate to
achieve some higher-level behavior.
• Object-oriented analysis and design is the method that leads us to an object
oriented decomposition; object-oriented design uses a notation and process for
constructing complex software systems and offers a rich set of models with
which we may reason about different aspects of the system under
consideration.