Introduction
OOA ( Object Oriented Analysis) :
It is discovery and documentation of the key problem domain classes which are related with
developing and OOM of the problem domain.
Benefits of OOA
Maintainbility
Reusability
Productivity
Prodctivity
OOD(Object Oriented Design):
It is concerned with developing OOM of s/w to implement the requirement identified by OOA.
Object Orientation
Definition: OO means that we organize software as a collection of discrete objects
(that incorporate both data structure and behaviour).
There are four aspects (characteristics) required by an OO.
approach Identity. Classification. Inheritance. Polymorphism.
Identity: Identity means that data is quantized into discrete, distinguishable entities
called objects.
E.g. for objects: personal computer, bicycle, queen in chess etc.
Object Oriented Development
Development refers to the software life cycle: Analysis, Design and
Implementation.
The essence of OO Development is the identification and organization of
application concepts, rather than their final representation in a programming
language.
It‘s a conceptual process independent of programming languages.
OO development is fundamentally a way of thinking and not a programming
technique.
Object Oriented Development
Object Oriented Themes
1. Abstraction:
It represents behavior of real world entity.
Manages complexity by concentrating on essential or important aspects making an
entity different from others.
2. Encapsulation:
Wrapping of data
Separates implementation from users or clients
3. Modularity (combining data and behavior):
Break up complex systems into small, self contained and easily understandable
pieces.
Binding data together & hiding them outside world.
MODELLING AS A DESIGN TECHNIQUE
Testing a physical entity before building it: Medieval built scale models of Gothic Cathedrals to
test the forces on the structures. Engineers test scale models of airplanes, cars and boats to
improve their dynamics.
Communication with customers: Architects and product designers build models to show their
customers (note: mock-ups are demonstration products that imitate some of the external
behavior of a system).
Visualization: Storyboards of movies, TV shows and advertisements let writers see how their
ideas flow.
Reduction of complexity: Models reduce complexity to understand directly by separating out a
small number of important things to do with at a time.
What is Object Oriented Data 7
Modeling?
Centers around objects and classes
Involves inheritance
Encapsulates both data and behavior
Benefits of Object-Oriented Modeling
Ability to tackle challenging problems
Improved communication between users, analysts, designer, and programmers
Increased consistency in analysis and design
Explicit representation of commonality among system components
System robustness
Reusability of analysis, design, and programming results
Abstraction
Abstraction is the selective examination of certain aspects of a problem.
The goal of abstraction is to isolate those aspects that are important for some purpose and
suppress those aspects that are unimportant.
THE THREE MODELS
Three kinds of models to describe a system from different viewpoints
1. Class model
2. State model
3. Interaction model
Class Model
Describes basic structure of objects and their relationship
Contains class diagram
Class diagram is a graph whose nodes are object classes ( Classes ) and
whose arcs are relationships among classes.
State model
Describes the aspects of a system that change over time.
It specifies and implement control aspects of a system.
Contains state diagram.
State diagram is a graph whose nodes are states and whose arcs are data-
flows.
Interaction Model
Describes how the objects in a system cooperate to achieve border result.
Contains Use Case, Sequence diagram and activity diagram.
Use case focuses on the functionality of a system – that is what a system does for a
user.
Sequence diagram shows the object that interact and the time sequence of their
interaction.
Activity diagram elaborate important processing steps.
Object and Class concepts
Objects
Define objects as a concept, abstraction or thing with identity that has meaning for
an application.
All Objects have identity and are distinguishable.
eg.:- Two apples can be described as 2 different objects even though they have
the same descriptive properties.
Classes
An object class describes a group of objects with similar properties ( attributes ),
behavior (operations), relationships to other objects and semantics.
Class Diagram
There are two kinds of models of structure
It provides a graphical notation for modeling classes and their relationship,
thereby describing possible objects.
Person Company
UML symbol for class is a box. List class name in boldface, center the name in the
box, and capitalize the first letter.
Class diagrams are useful both for abstract modeling and designing actual
program.
Object Diagram
It shows individual objects and their relationship.
A class diagram can have infinite set of object diagram.
JoeSmith: Person Adam: Person :Person
TCS: Comany IBM: Company
UML symbol for object is a box with an object name followed by a colon and
class name. the object and class name are both underlined.
Links and Association Concepts
Links and associations are the means for establishing relationships among objects
and classes.
A link is a physical or conceptual connection between objects.
A link is an instance of an association.
An association describes a group of links with common structure and semantics.
All the links in an association connect objects from the same classes.
Association and links often appear as verbs in a problem statement.
An association describes a set of potential links in the same way that a class
describes a set of potential objects.
Associations
Associations are bidirectional
In real, both directions of traversal are equally meaningful and refer to same
association.
Associations are often implemented in programming languages as pointers from one
object to another.
A pointer is an attribute in one object that contains an explicit reference to another
object.
A link shows a relationship between two or more objects.
All connections among classes should be modeled as association.
One-to-One association.
Many-to-many association.
Ternary association.
Generalization and Inheritance
Generalization is a relationship between a super class and subclass.
Each subclass is said to be inherit the features of its super class.
It is “is-a” relationship because each instance of a sub class is an instance of super
class as well.
UML notation for a generalization is a large hollow arrowhead. The arrowhead
points to the super class.
Super class may directly connect to each subclass, but normally prefer to group
subclass as a tree.
A generalization set name is an enumerated attribute that indicates which aspect of
an object is being abstracted by a particular generalization.
Use of Generalization
Generalization has three purpose.
It support for polymorphism.
It structure the description of objects.
It enable reuse of code.
The word generalization derives from the fact that the superclass generalizes the
subclass.
The word specialization refers to the fact that the subclass refine or specialize the
superclass.
Inheritance is the mechanism for sharing attributes, operations and association via
the generalization/specialization relationship.
Navigation of class models
Navigation is important because it lets you exercise a model and uncover
hidden flaws and omissions so that you can repair them.
It is possible to perform navigation manually or write navigation expressions.
UML incorporates a language that express several kinds of question asked on
model- object constraint language(OCL)