Chapter I - Intro OOM
Chapter I - Intro OOM
Chapter I: Generalities
Contents
I. INTRODUCTION............................................................................................................................... 2
II. OBJECT ORIENTED MODELING ............................................................................................. 3
a. OOM processes................................................................................................................................ 3
b. Models used by OOMT................................................................................................................... 4
c. Object Modelling VS Structured development ............................................................................ 5
III. BASIC PHILOSOPHY OF OBJECT ORIENTATION ............................................................. 6
a. Abstraction ...................................................................................................................................... 6
b. Encapsulation .................................................................................................................................. 6
c. Polymorphism ................................................................................................................................. 7
d. Sharing of Structure and Behaviour ............................................................................................. 7
IV. CHARACTERISTICS OF OBJECT-ORIENTED MODELING .............................................. 8
a. Class and Objects ............................................................................................................................ 8
b. Links and Association ..................................................................................................................... 9
c. Generalization and Inheritance ..................................................................................................... 9
➢ Generalization ............................................................................................................................. 9
➢ Inheritance ................................................................................................................................... 9
V. WHAT IS UML? ............................................................................................................................... 11
a. Historical background .................................................................................................................. 11
b. Goals of UML ................................................................................................................................ 12
c. A Conceptual Model of UML ....................................................................................................... 12
d. Object-Oriented Concepts ............................................................................................................ 13
e. OO Analysis and Design ............................................................................................................... 13
f. Role of UML in OO Design .......................................................................................................... 14
g. Types of UML Models .................................................................................................................. 15
➢ Structural Modeling.................................................................................................................. 15
➢ Behavioral Modeling ................................................................................................................. 15
➢ Architectural Modeling ............................................................................................................ 16
• QUESTIONS ..................................................................................................................................... 17
I. INTRODUCTION
Object oriented design methods emerged in the 1980s, and object oriented analysis methods
emerged during the 1990s. In the early stage, object orientation was largely associated with the
development of graphical user interfaces (GUIs), and a few other applications became widely
known. In the 1980s, Grady Booch published a paper on how to design for Ada, and gave it the
title, Object Oriented Design. In 1991, Booch was able to extend his ideas to a genuinely object
oriented design method in his book with the same title, revised in 1993 (Booch, 1994).
The Object Modeling Technique (OMT) covers aspects of object oriented analysis and design.
OOT provides a very productive and practical way of Software development. As object oriented
Technology (OOT) is not language dependent, there is no need for considering a final
implementation language, during Object Oriented Modeling (OOM). OOT combine structural,
control and functional aspects of the system.
In chapter unit, we will discuss the basic notions of object orientation. This unit will cover
discussion on objects, classes, links, association, generalization, and inheritance. We
will discuss the basics of an object model with the help of an example. Towards the
end of this unit we will cover the benefits of OOM.
It is important to note that with the increasing complexity of systems, importance of modelling
techniques increases. Because of its characteristics, Object Oriented Modelling is a suitable
modelling technique for handling a complex system. OOM basically is building a model of an
application, which includes implementation details of the system, during design of the system.
Any system development refers to the initial portion of the software life cycle: analysis, design,
and implementation. During object-oriented modelling identification and organization of
application with respect to its domain is done, rather than their final representation in any specific
programming language. We can say that OOM is not language specific. Once modelling is done
for an application, it can be implemented in any suitable programming language available.
a. OOM processes
OOM approach is an encouraging approach in which software developers have to think
in terms of the application domain through most of the software engineering life
cycle. In this process, the developer is forced to identify the inherent concepts of the
application. First, developer organize, and understood the system properly and then
finally the details of data structure and functions are addressed effectively.
• System Analysis
• System Design
• Object Design, and
• Final Implementation
System Analysis: In this stage a statement of the problem is formulated and a model is built by
the analyst in encouraging real-world situation. This phase shows the important properties
associated with the situation. Actually, the analysis model is a concise, precise abstraction and
agreement on how the desired system must be developed. You can say that, here the objective is
to provide a model that can be understood and criticized by any application experts in the area
whether the expert is a programmer or not.
System Design: At this stage, the complete system architecture is designed. This is the stage where
the whole system is divided into subsystems, based on both the system analysis model and the
proposed architecture of the system.
Object Design: At this stage, a design model is developed based on the analysis model which is
already developed in the earlier phase of development. The object design decides the data
structures and algorithms needed to implement each of the classes in the system with the help of
implementation details given in the analysis model.
Final Implementation: At this stage, the final implementation of classes and relationships
developed during object design takes place a particular programming language, database, or
hardware implementation (if needed). Actual implementation should be done using software
engineering practice. This helps to develop a flexible and extensible system.
Object models are used for describing the objects in the system and their relationship
among each other in the system. The dynamic model describes interaction among
objects and information flow in the system. The data transformations in the system are
described by a functional model.
All three models are applicable during all stages of development. These models bear the
responsibility of acquiring implementation details of the system development. It is important to
note that you cannot describe a system completely until unless all three models are described
properly. We will discuss these three models in detail in further sections.
In contrast to the structured approach, the basic focus of object-oriented approach is to identify
object from the application domain, and then to associate procedures (methods) around these
identified objects. You can say that object-oriented development is an indirect way of system
development because in this approach a holistic view of application domain is considered, and
objects are identified in the related problem domain. A historic view of application helps in
realizing the situations and characteristics of the system.
Taking a holistic view of the problem domain rather than considering functional
requirements of a single problem give an edge to object-oriented development. Once the
objects are created with the needed characteristics, they communicate with each other by message
passing during problem solving.
Now, let us discuss about the basic characteristics around which object-oriented systems are
developed.
a. Abstraction
Abstraction is one of the very important concepts of object-oriented systems Abstraction focus on
the essential, inherent aspects of an object of the system. It does not represent the accidental
properties of the system. In system development, abstraction helps to focus on what an object is
supposed to do, before deciding how it should be implemented. The use of abstraction protects the
freedom to make decisions for as long as possible, by avoiding intermediate commitments in
problem solving. Most of the modern languages provide data abstraction. With the abstraction,
ability to use inheritance and ability to apply polymorphism provides additional freedom and
capability for system development. When you are using abstraction during analysis, you have to
deal with application-domain concepts. You do not have to design and make implementation
decisions at that point.
b. Encapsulation
Encapsulation, or information hiding, is the feature of separating the external aspect of an object,
from the internal implementation details of that object. It helps in hiding the actual implementation
of characteristics of objects. You can say that encapsulation is hiding part of implementation that
do internal things, and these hidden parts are not concerned to outside world. Encapsulation
enables you to combine data structure and behaviour in a single entity. Encapsulation helps in
system enhancement. If there is a need to change the implementation of object without affecting
its external nature, encapsulation is of great help.
c. Polymorphism
Class hierarchy is the deciding factor in the case of more than one implementation of
characteristics. An object-oriented program to calculate the area of different Figures would simply
call the Find_ Area operation on each figure whether it is a circle, triangle, or something else. The
decision of which procedure to use is made implicitly by each object, based on its class
polymorphism makes maintenance easier because the calling code need not be modified when a
new class is added.
in the system than on the procedure structure to be used for implementation. During this process
what an object is, and its role in system is deeply thought about.
• Attributes are named slots for data values that belong to the class. Different objects of a
given class typically have at least some differences in the values of their attributes.
• Operations represent services that an object can request to affect the behaviour of the object
or the system itself.
➢ Inheritance
Inheritance is taken in the sense of code reuse within the object-oriented development. During
modelling, we look at the resulting classes, and try to group similar classes together so that code
reuse can be enforced. Generalization, specialization, and inheritance have very close association.
Generalization is used to refer to the relationship among classes, and inheritance is used for sharing
attributes and operations using the generalization relationship. In respect of inheritance,
generalization and specialization are two phases of a coin in the sense that if a subclass is seen
from a superclass the subclass is seen as a specialized version of superclass and in, reverse, a
superclass looks like general form of subclass. During inheritance, a subclass may override a
superclass feature by defining that feature with the same name. The overriding features (the
subclass feature with the same names of superclass features) refines and replaces the overridden
feature (the superclass feature).
Now let us look at the diagram given in the figure below. In this diagram, Circle, Triangle, and
Square classes are inherited from Shape class. This is a case of single inheritance because here,
one class inherits from only one class.
Let us describe the UML language that we’ll using in this course for modelling.
V. WHAT IS UML?
UML is a standard language for specifying, visualizing, constructing, and documenting the
artifacts of software systems.
UML was created by the Object Management Group (OMG) and UML 1.0 specification draft was
proposed to the OMG in January 1997.
OMG is continuously making efforts to create a truly industry standard.
• UML stands for Unified Modeling Language.
• UML is different from the other common programming languages such as C++, Java,
COBOL, etc.
• UML is a pictorial language used to make software blueprints.
• UML can be described as a general-purpose visual modeling language to visualize, specify,
construct, and document software system.
• Although UML is generally used to model software systems, it is not limited within this
boundary. It is also used to model non-software systems as well. For example, the process
flow in a manufacturing unit, etc.
UML is not a programming language but tools can be used to generate code in various languages
using UML diagrams. UML has a direct relation with object-oriented analysis and design.
After some standardization, UML has become an OMG standard.
a. Historical background
In the mid-1980s, a number of techniques began to emerge for object-oriented-analysis and design.
Examples:
– Coad & Yourdon;
– Booch;
– Rumbaugh (the OMT technique);
– Coleman (FUSION).
Mid 1990s is characterised by a move towards standardisation, driven by the Object Management
Group (OMG) that leads to the creation of a unified language: The Unified Modelling Language
(UML)
UML is essentially a notation, and not a technique. Notation can be used in many different ways:
b. Goals of UML
A picture is worth a thousand words, this idiom absolutely fits describing UML. Object-oriented
concepts were introduced much earlier than UML. At that point of time, there were no standard
methodologies to organize and consolidate the object-oriented development. It was then that UML
came into picture.
There are a number of goals for developing UML but the most important is to define some general-
purpose modeling language, which all modelers can use and it also needs to be made simple to
understand and use.
UML diagrams are not only made for developers but also for business users, common people, and
anybody interested to understand the system. The system can be a software or non-software
system. Thus, it must be clear that UML is not a development method rather it accompanies with
processes to make it a successful system.
In conclusion, the goal of UML can be defined as a simple modeling mechanism to model all
possible practical systems in today’s complex environment.
As UML describes the real-time systems, it is very important to make a conceptual model and then
proceed gradually. The conceptual model of UML can be mastered by learning the following three
major elements.
• UML building blocks
• Rules to connect the building blocks
• Common mechanisms of UML
d. Object-Oriented Concepts
UML can be described as the successor of object-oriented (OO) analysis and design.
An object contains both data and methods that control the data. The data represents the state of the
object. A class describes an object and they also form a hierarchy to model the real-world system.
The hierarchy is represented as inheritance and the classes can also be associated in different ways
as per the requirement.
Objects are the real-world entities that exist around us and the basic concepts such as abstraction,
encapsulation, inheritance, and polymorphism all can be represented using UML.
UML is powerful enough to represent all the concepts that exist in object-oriented analysis and
design. UML diagrams are representation of object-oriented concepts only. Thus, before learning
UML, it becomes important to understand OO concept in detail.
Following are some fundamental concepts of the object-oriented world −
• Objects − Objects represent an entity and the basic building block.
• Class − Class is the blue print of an object.
• Abstraction − Abstraction represents the behavior of a real-world entity.
• Encapsulation − Encapsulation is the mechanism of binding the data together and hiding
them from the outside world.
• Inheritance − Inheritance is the mechanism of making new classes from existing ones.
• Polymorphism − It defines the mechanism to exists in different forms.
Thus, it is important to understand the OO analysis and design concepts. The most important
purpose of OO analysis is to identify objects of a system to be designed. This analysis is also done
for an existing system. Now an efficient analysis is only possible when we are able to start thinking
in a way where objects can be identified. After identifying the objects, their relationships are
identified and finally the design is produced.
There are three basic steps where the OO concepts are applied and implemented. The steps can be
defined as
OO Analysis → OO Design → OO implementation using OO languages
of the UML diagrams discussed so far are used to model different aspects such as static, dynamic,
etc. Now whatever be the aspect, the artifacts are nothing but objects.
If we look into class diagram, object diagram, collaboration diagram, interaction diagrams all
would basically be designed based on the objects.
Hence, the relation between OO design and UML is very important to understand. The OO design
is transformed into UML diagrams according to the requirement. Before understanding the UML
in detail, the OO concept should be learned properly. Once the OO analysis and design is done,
the next step is very easy. The input from OO analysis and design is the input to UML diagrams.
➢ Structural Modeling
Structural modeling captures the static features of a system. They consist of the following −
• Classes diagrams
• Objects diagrams
• Deployment diagrams
• Package diagrams
• Composite structure diagram
• Component diagram
Structural model represents the framework for the system and this framework is the place where
all other components exist. Hence, the class diagram, component diagram and deployment
diagrams are part of structural modeling. They all represent the elements and the mechanism to
assemble them.
The structural model never describes the dynamic behavior of the system. Class diagram is the
most widely used structural diagram.
➢ Behavioral Modeling
Behavioral model describes the interaction in the system. It represents the interaction among the
structural diagrams. Behavioral modeling shows the dynamic nature of the system. They consist of
the following −
• Activity diagrams
• Interaction diagrams
• Use case diagrams
All the above show the dynamic sequence of flow in a system.
➢ Architectural Modeling
Architectural model represents the overall framework of the system. It contains both structural and
behavioral elements of the system. Architectural model can be defined as the blueprint of the entire
system. Package diagram comes under architectural modeling.
QUESTIONS
1. What is OOM?
2. List different steps involved in OOM process
3. Differentiate OO development from structured development
4. What is abstraction?
5. What is association? Give example of association.