UNIT-I:
Introduction: The Structure of Complex systems, The Inherent Complexity of Software, Attributes of
Complex System, Organized and Disorganized Complexity, Bringing Order to Chaos, Designing
Complex Systems, Evolution of Object Model, Foundation of Object Model, Elements of Object Model,
Applying the Object Model.
The Structure of Complex Systems
Examples of Complex Systems
The Structure of a Personal Computer A personal computer is a device of moderate complexity.
Most of them are composed of the same major elements: a central processing unit (CPU), a monitor, a
keyboard, and some sort of secondary storage device, usually either a floppy disk or a hard disk drive.
We may take any one of these parts and further decompose it. For example, a CPU typically
encompasses primary memory, an arithmetic/logic unit (ALU), and a bus to which peripheral devices
are attached. Each of these parts may in turn be further decomposed: an ALU may be divided into
registers and random control logic, which themselves are constructed from even more primitive
elements, such as NAND gates, inverters, and so on.
Here we see the hierarchic nature of a complex system. A personal computer functions properly only
because of the collaborative activity of each of its major parts. Together, these separate parts logically
form a whole. Indeed, we can reason about how a computer works only because we can decompose it
into parts that we can study separately. Thus, we may study the operation of a monitor independently
of the operation of the hard disk drive. Not only are complex systems hierarchic, but the levels of this
hierarchy represent different levels of abstraction, each built upon the other, and each understandable
by itself. At each level of abstraction, we find a collection of devices that collaborate to provide
services to higher layers.
The Structure of Plants and Animals In botany, scientists seek to understand the similarities and
differences among plants through a study of their morphology, that is, their form and structure. Plants
are complex multicellular organisms, and from the cooperative activity of various plant organ systems
arise such complex behaviors as photosynthesis and transpiration.
Plants consist of three major structures (roots, stems, and leaves), and each of these has its own
structure. For example, roots encompass branch roots, root hairs, the root apex, and the root cap.
Similarly, a cross-section of a leaf reveals its epidermis, mesophyll, and vascular tissue. Each of these
structures is further composed of a collection of cells, and inside each cell we find yet another level of
complexity, encompassing such elements as chloroplasts, a nucleus, and so on. As with the structure of
a computer, the parts of a plant form a hierarchy, and each level of this hierarchy embodies its own
[Link] parts at the same level of abstraction interact in well-defined ways. For example, at the
highest level of abstraction, roots are responsible for absorbing water and minerals from the soil. Roots
interact with stems, which transport these raw materials up to the leaves. The leaves in turn use the
water and minerals provided by the stems to produce food through photosynthesis.
There are always clear boundaries between the outside and the inside of a given level. For example, we
can state that the parts of a leaf work together to provide the functionality of the leaf as a whole, and
yet have little or no direct interaction with the elementary parts of the roots. In simpler terms, there
is a clear separation of concerns among the parts at different levels of abstraction.
Turning briefly to the field of zoology, we note that multicellular animals exhibit a hierarchical
structure similar to that of plants: collections of cells form tissues, tissues work together as organs,
clusters of organs define systems (such as the digestive system), and so on. We cannot help but again
notice God's awesome economy of expression: the fundamental building block of all animal matter is
the cell, just as the cell is the elementary structure of all plant life. Granted, there are differences
between these two. For example, plant cells are enclosed by rigid cellulose walls, but animal cells are
not. A number of mechanisms above the cellular level are also shared by plant and animal fife. For
example, both use some sort of vascular system to transport nutrients within the organism, and both
exhibit differentiation by sex among members of the same species.
The Structure of Matter The study of fields as diverse as astronomy and nuclear physics provides us
with many other examples of incredibly complex systems. Spanning these two disciplines, we find yet
another structural hierarchy. Astronomers study galaxies that are arranged in clusters, and stars,
planets, and various debris are the constituents of galaxies. Likewise, nuclear physicists are concerned
with a structural hierarchy, but one on an entirely different scale. Atoms are made up of electrons,
protons, and neutrons; electrons appear to be elementary particles, but protons, neutrons, and other
particles are formed from more basic components called quarks
The Structure of Social Institutions As a final example of complex systems, we turn to the structure
of social institutions. Groups of people join together to accomplish tasks that cannot be done by
individuals. Some organizations are transitory, and some endure beyond many lifetimes. As
organizations grow larger, we see a distinct hierarchy emerge. Multinational corporations contain
companies, which in turn are made up of divisions, which in turn contain branches, which in turn
encompass local offices, and so on. If the organization endures, the boundaries among these parts may
change, and over time, a new, more stable hierarchy may emerge.
The relationships among the various parts of a large organization are just like those found among the
components of a computer, or a plant, or even a galaxy. Specifically, the degree of interaction among
employees within an individual office is greater than that between employees of different offices. A
mail clerk usually does not interact with the chief executive officer of a company but does interact
frequently with other people in the mail room. Here too, these different levels are unified by common
mechanisms. The clerk and the executive are both paid by the same financial organization, and both
share common facilities, such as the company's telephone system, to accomplish their tasks.
The Inherent Complexity of software
Why Software Is Inherently Complex
As Brooks suggests, "The complexity of software is an essential property, not an accidental one". We
observe that this inherent complexity derives from four elements: the complexity of the problem
domain, the difficulty of managing the developmental process, the flexibility possible through
software, and the problems of characterizing the behavior of discrete systems.
The Complexity of the Problem Domain The problems we try to solve in software often involve
elements of inescapable complexity, in which we find a myriad of competing, perhaps even
contradictory, requirements. Consider the requirements for the electronic system of a multi-engine
aircraft, a cellular phone switching system, or an autonomous robot. The raw functionality of such
systems is difficult enough to comprehend, but now add all of the (often implicit) nonfunctional
requirements such as usability, performance, cost, survivability, and reliability. This unrestrained
external complexity is what causes the arbitrary complexity about which Brooks writes. A further
complication is that the requirements of a software system often change during its development, largely
because the very existence of a software development project alters the rules of the problem
This external complexity usually springs from the "impedance mismatch" that exists between the users
of a system and its developers: users generally find it very hard to give precise expression to their
needs in a form that developers can understand In extreme cases, users may have only vague ideas of
what they want in a software system. This is not so much the fault of either the users or the developers
of a system; rather, it occurs because each group generally lacks expertise in the domain of the other. A
further complication is that the requirements of a software system often change during its development,
largely because the very existence of a software development project alters the rules of the problem.
The task of the software development team is to engineer the illusion of simplicity
The Difficulty of Managing the Development Process The fundamental task of the software
development team is to engineer the illusion of simplicity - to shield users from this vast and often
arbitrary external complexity. Certainly, size is no great virtue in a software system. We strive to write
less code by inventing clever and powerful mechanisms that give us this illusion of simplicity, as well
as by reusing frame-works of existing designs and code. Just two decades ago, assembly language
programs of only a few thousand lines of code stressed the limits of our software engineering abilities.
Today, it is not unusual to find delivered systems whose size is measured in hundreds of thousands, or
even millions of lines of code. If we decompose our implementation in meaningful ways, we still end
up with hundreds and sometimes thousands of separate modules. However, no matter what its size,
there are always significant challenges associated with team development. More developers means
more complex communication and hence more difficult coordination, particularly if the team is
geographically dispersed. With a team of developers, the key management challenge is always to
maintain a unity and integrity of design.
The Flexibility Possible Through Software Software offers the ultimate flexibility, so it is possible
for a developer to express almost any kind of abstraction. This flexibility turns out to be an incredibly
seductive property, however, because it also forces the developer to craft virtually all the primitive
building blocks upon which these higher-level abstractions stand. As a result, software development
remains a labor-intensive business.
The Problems of Characterizing the Behavior of Discrete Systems Within a large application, there
may be hundreds or even thousands of variables as well as more than one thread of control. The entire
collection of these variables, their current values, and the current address and calling stack of each
process within the system constitute the present state of the application. Because we execute out software
on digital computers, we have a system with discrete states. External event may corrupt the state of a
system because its designers failed to take into account certain interactions among events. If any system
is described by a continuous function, we are saying that it can contain no hidden surprises. Small
changes in inputs will always cause correspondingly small changes in outputs. 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. In continuous system one state may not
change the other state/behavior change would be unlikely, but in discrete systems all external events can
affect any part of the system's internal state.
The Five Attributes of a Complex System
1. Hierarchical and interacting subsystems
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.
2. Arbitrary determination of primitive components
The choice of what components in a system are primitive is relatively arbitrary and is largely up to the
discretion of the observer of the system.
3. Stronger intra-component than inter-component link
Intra-component linkages are generally stronger than inter-component linkages. This fact has the effect
of separating the high-frequency dynamics of the components - involving the internal structure of the
components - from the low-frequency dynamics - involving interaction among components.
4. Combine and arrange common rearranging subsystems
Hierarchic systems are usually composed of only a few different kinds of subsystems in various
combinations and arrangements . i.e complex systems have common patterns.
5. Evolution from simple to complex systems
A complex system that works is invariably found to have evolved from a simple system that worked.... A
complex system designed from scratch never works and cannot be patched up to make it work. You have
to start over, beginning with a working simple system
Organized and Disorganized Complexity
The discovery of common abstractions and mechanisms greatly facilitates our understanding of complex
systems. For example, with just a few minutes of orientation, an experienced pilot can step into a
multiengine jet aircraft he or she has never flown before and safely fly the vehicle. Having recognized the
properties common to all such aircraft, such as the functioning of the rudder, ailerons, and throttle, the
pilot primarily needs to learn what properties are unique to that particular aircraft. If the pilot already
knows how to fly a given aircraft, it is far easier to learn how to fly a similar one.
Canonical form of complexity
This example suggests that we have been using the term hierarchy in a rather loose fashion. Most
interesting systems do not embody a single hierarchy; instead, we find that many different hierarchies are
usually present within the same complex system. For example, an aircraft may be studied by
decomposing it into its propulsion system, flight-control system, and so on. This decomposition
represents a structural, or "part of" hierarchy.
This second hierarchy represents an "is a" hierarchy. In our experience, we have found it essential to view
a system from both perspectives, studying its "is a" hierarchy as well as its "part of" hierarchy. For
reasons that will become clear in the next chapter, we call these hierarchies the class structure and
the object structure of the system, respectively
The Canonical Form of a Complex System
Combining the concept of the class and object structure together with the five attributes of a complex
system, we find that virtually all complex systems taken the same (canonical) form, as we show in Figure.
Here we see the two orthogonal hierarchies of the system: its class structure and its object structure. Each
hierarchy is layered, with the more abstract classes and objects built upon more primitive ones. Notice
that the class structure and the object structure are not completely independent; rather, each object in the
object structure represents a specific instance of some class. As the figure suggests, there are usually
many more objects than classes of objects within a complex system.
Bringing Order to Chaos:
Managing the Complexity
There are mainly three things which plays the vital role for managing the complexity, which are:
1. Decomposition
2. Abstraction
3. Hierarchical
1. The Role of Decomposition
The technique of mastering complexity has been known since ancient times: divide et impera (divide and
rule)". When designing a complex software system, it is essential to decompose it into smaller and
smaller parts, each of which we may then refine independently. to understand any given level of a system,
we need only comprehend a few parts (rather than all parts) at once. Intelligent decomposition directly
addresses the inherent complexity of software by forcing a division of a system's state space.
Decomposition Types:
1. Algorithmic Decomposition
2. Object-Oriented Decomposition
Algorithmic Decomposition
Each module in the system denotes a major step in some overall process.
Top –down structured design ,so this approaches of decomposition is a simple approach of
decomposition
The decomposition structure chart shows the relationships among various functional elements of
the solution
Fig below is the particular structure chart, which illustrates part of the design of a program that
updates the content of a master file
Object Oriented Decomposition
Decomposes the system according to the key abstractions in the problem domain,
rather than decomposing the problem into steps
Bottom up approach of decomposition
In Object oriented decomposition we view the world as a set of autonomous agents
thatcollaborate to perform some higher level behavior.
In this decomposition method ,each object in our solution embodies its own
behavior and each one models some object in the real world.
E.g. Here, 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 problem domain.
Although both designs solve the same problem they do so in quite different way.
Figure 1-3
Object-Oriented Decomposition
2. Role of Abstraction
Abstraction is a powerful technique for dealing complexity. Unable to master the entire
complexity, we choose to ignore its inessential details. For example, when studying how
photosynthesis works in a plant, we can focus on the chemical reactions in certain cells in a
leaf and ignore all other parts, such as the roots and stems. In general, abstraction assists
people understanding by grouping, generalizing and chunking information. Objects are
abstractions of entities in the real world. Properties that different classes have in common are
identified in more abstract classes and 'is a' relationship defines the inheritance between
classes.
[Link] of Hierarchy
Identifying the hierarchies with in the complex system makes understanding of the system
very simple. The class structure is important because it highlights common structure and
behavior within a system. By classifying objects into groups of related abstractions (e.g.,
kinds of plant cells versus animal cells), we come to explicitly distinguish the common and
distinct properties of different objects. Different hierarchies support the recognition of higher
and lower orders. A class high in the ‘is a’ hierarchy is a rather abstract concept and the leaf
represents ‘part of’ hierarchy. Note that there are many other forms of patterns which are
non-hierarchical: relationships.
Designing complex systems:
Every engineering discipline involves both science and art. The role of the engineer as artist
is particularly challenging when the task is to design an entirely new system
The meaning of design:
Design is the disciplined approach we use to invent a solution for some problem, thus
providing a path from requirements to implementation.
Mostow suggests that the purpose of design is to construct a system that:
Satisfies a given (perhaps informal) functional specification
Conforms to limitations of the target medium
Meets implicit or explicit requirements on performance and resource usage
Satisfies implicit or explicit design criteria on the form of the artifact
Satisfies restrictions on the design process itself, such as its length or cost,
or the tools available for doing the design.
As Stroustrup suggests, “the purpose of design is to create a clean and relatively
simple internal structure, sometimes also called an architecture. . . . A design is
the end product of the design process”.
The Elements of Software Design Methodologies:
The design of complex software systems considers five attributes of complex systems and the
design of such systems involves an incremental and iterative process. Specifically each
include 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 helps in model building and enforce rules about about model.
Models of Object oriented development:
The Models of Object-Oriented Development Is there a "best” design method? No, there is no
absolute answer to this question, which is actually just a veiled way of asking the earlier
question: What is the best way to decompose a complex system? To reiterate, we have found
great value in building models that are focused up on the "things" we find, in the problem
space, forming what we refer to as an objectoriented decomposition Object-oriented analysis
and design is the method that leads us to an object-oriented decomposition. By applying
object-oriented design, we create software that is resilient to change and written with
economy of expression. We achieve a greater level of confidence in the correctness of our
software through an intelligent separation of its state space. Ultimately, we reduce the risks
that are inherent in developing complex software systems.
Figure: The Models of Object-Oriented Development
Evolution of Object Model:
Trends in Software Engineering:
The shift in focus from programming-in-the-small to programming-in-the large
The evolution of high-order programming languages.
New industrial-strength software systems are larger and more complex than their
predecessors.
Wegner has classified some of the more popular high-order programming languages in
generations arranged according to the language features they first introduced
First-generation languages (1954–1958):
Used for specific and engineering applications.
• FORTRAN I -Mathematical expressions
• ALGOL 58 -Mathematical expressions
• Flowmatic -Mathematical expressions
• IPL V -Mathematical expressions.
Second-generation languages (1959–1961)
gives importance to algorithmic abstraction
• FORTRAN II - Subroutines, separate compilation
• ALGOL 60 -Block structure, data types
• COBOL -Data description, file handling
• Lisp- List processing, pointers, garbage collection
Third-generation languages (1962–1970)
Supports data abstraction
• PL/1 - FORTRAN + ALGOL + COBOL
• ALGOL 68 -Rigorous successor to ALGOL 60
• Pascal -Simple successor to ALGOL 60
• Simula- Classes, data abstraction.
The generation gap (1970–1980)
Many different languages were invented, but few endured. However, the following are worth
noting:
• C -Efficient; small executables
• FORTRAN 77 - ANSI standardization.
Object-orientation boom (1980–1990, but few languages survive)
• Smalltalk 80- Pure object-oriented language
• C++ -Derived from C and Simula
• Ada83 -Strong typing; heavy Pascal influence
• Eiffel -Derived from Ada and Simula
Emergence of frameworks (1990–today)
Much language activity, revisions, and standardization have occurred, leading to
programming frameworks.
• Visual Basic- Eased development of the graphical user interface (GUI) for Windows
applications
• Java -Successor to Oak; designed for portability
• Python -Object-oriented scripting language
• J2EE -Java-based framework for enterprise computing
• .NET -Microsoft’s object-based framework
• Visual C# -Java competitor for the Microsoft .NET Framework
• Visual Basic .NET -Visual Basic for the Microsoft .NET Framework.
The Topology of First and Early Second Generation Programming Languages:
• Topology, we mean the basic physical building blocks of the language and how those
parts can be connected.
• The arrows in this figure indicate dependencies of the subprograms on various data.
• An error in one part of a program can have effect across the rest of the [Link]
modifications are made to a large system, it is difficult to maintain the integrity of the
original design.
The Topology of Late Second and Early Third-Generation Programming Languages:
Subprograms could serve as an abstraction mechanism had three important consequences.
• First, languages were invented that supported a variety of parameter-passing
mechanisms.
• Second, the foundations of structured programming were laid, manifesting themselves
in language support for the nesting of subprograms and regarding control structures.
• Third, structured design methods emerged, offering guidance to designers trying to
build large systems using subprograms as basic physical building blocks.
The Topology of Late Third-Generation Programming Languages:
• Modules were rarely recognized as an important abstraction mechanism.
• Larger programming projects meant larger development teams, and thus the need to
develop different parts of the same program independently.
The Topology of Object-Based and Object- Oriented Programming Languages:
• The physical building block in such languages is the module, which represents a
logical collection of classes and objects instead of subprograms.
• Data & operations are united in such a way that the fundamental logical building
blocks of our systems are no longer algorithms but are classes & objects.
• Procedure oriented program is organized around verbs & object oriented program is
organized around nouns.
Foundation of Object Model:
Structured design methods evolved to guide developers who were trying to build complex
systems using algorithms as their fundamental building blocks. Similarly ,object-oriented
design methods have evolved to help developers in object-based and object-oriented
programming languages, using the class and object as basic building blocks .
Object oriented Analysis:
The object model has influenced even earlier phases of the software development Lifecycle.
Object-oriented analysis is a method of analysis that examines requirements from the
perspective of the classes and objects found in the vocabulary of the problem domain.
Object oriented design:
Object-oriented design is a method of design encompassing the process of object oriented
decomposition and a notation for depicting both logical and physical as well as static and
dynamic models of the system under design.
Object oriented programming:
Object-oriented programming is a method of implementation in which programs are
organized as cooperative collections of objects, each of which represents an instance of some
class, and whose classes are all members of a hierarchy of classes united via inheritance
relationships.
Figure: Representation of Objects
Elements of Object model:
Kinds of programming paradigms:
Programming style is a way of organizing programs on the basis of some conceptual model
of programming. There are five main kinds of programming styles:
1. Procedure-oriented-- Algorithms
2. Object-oriented-- Classes and objects
3. Logic-oriented --Goals, often expressed in a predicate calculus
4. Rule-oriented --If–then rules
5. Constraint-oriented --Invariant relationships.
Each requires a different mindset, a different way of thinking about the problem. Object
model is the conceptual framework for all things.
There are four major elements of this model:
1. Abstraction
2. Encapsulation
3. Modularity
4. Hierarchy.
By major, we mean that a model without any one of these elements is not object oriented.
There are three minor elements of the object model:
1. Typing
2. Concurrency
3. Persistence
By minor, we mean that each of these elements is a useful, but not essential, part of the object
model.