Object Oriented Analysis and
Design
Lecture#1
Topics
What are Complex systems?
Role of Decomposition.
Basic Concepts of Object Oriented Paradigm; Object
Model
Introduction to Object Oriented Analysis & Design;
Classes and Objects: nature of class, relationship among
classes, state of object, object’s behaviour
IBM Rational Unified Process,
Introduction to Unified Modeling Language(UML)
• Introduction of Design Patterns;
• GRASP:
Design Class Diagram,
Mapping Data Model to Domain Model;
GoF Design Patterns:
Creational,
Structural, and
Behavioral Patterns;
• Testing in Object Oriented Environment; Testing Tools;
• Design Implementation Aspects;
• Current Trends and Practices.
Important Questions
What is Analysis and Design?
Investigation of problem
Conceptual Solution
Do the Right thing, and do the thing Right
Key Concepts:
Object
Object oriented (OO)
OO View point
Difference with the previous methodologies
Key terms…
Objects
Instances of a specific class
Object inherits class’ attributes and operations
Attributes
Collection of data values that describe a class
Class
Encapsulates data and procedural abstractions, required to
describe the content and behavior of some real world entity
Operations
Methods and services provide a representation of one of the
behaviors of a class
Key terms
Sub class
Specialization of the super class may inherit both attributes and
operations from a super class
Super class
Generalization of set of classes
Object
Represent real world entity into a program.
Example:
Employee
Student
University
Object is an instance of a class.
Object is a variable of user defined type / abstract data type.
Class
Template for an object.
Contains data and there behavior / methods in it
Several instances can be created
Some other common definitions
1. A collection of data and code to handle that data.
2. Class is a user defined type / abstract data type.
3. Class defines basic layout and functionality of an object
Abstraction
Some other common definitions
Abstraction is a process of mimicking a behavior.
Simplifying complex reality by modeling classes
appropriate to problem.
Abstraction is a process that involves identifying the
crucial behavior of an object and eliminating irrelevant
and tedious details.
Encapsulation
Binding the data and code to access that data.
Encapsulation only refers to a container which has a data
and its related functions in it.
Some other common definitions
When an objects state and behavior are kept together they
are encapsulated. The data and the methods that
manipulated that data are stored together in cohesive unit.
Data Hiding / Information Hiding
As encapsulation bind data and methods together, data
hiding restrict sensitive data accessing to the system. It is
also achieved by using access modifiers i.e. Private,
Protected and Public.
In Figure 1 you can see in class Employee that there are
notations minus(-) and Plus(+) they represents access
modifier, minus sign restrict access outside the class and
plus sign gives access outside the class.
Some other common definitions
1. Insulation of data from direct access by the program.
Inheritance:
Defining new classes from the existing one. The new class
will get all the methods and properties of the existing class.
The new class known as sub class / child class / derived
class.
The existing class known as super class / parent class / base
class.
Inheritance is implied by “is-a” or “kind-of” relationship.
Used for reusability the code
Some other common definitions
An object can acquire the properties of another object.
Polymorphism
Ability to acquire different forms.
In Compile Time Polymorphism Object knows about itself at compile time.
Overloading is a compile time polymorphism.
Overloading method should have same name with different arguments.
Sum of two or three number what ever user will pass.
Create two methods with same name sum and assign 2 and 3 arguments into it.
Run Time Polymorphism,
Object does not know about itself at compile time it assigns all the properties and methods at
runtime.
Overriding or inheritance-based polymorphism are kind of polymorphism.
Simple and very common example I am talking about is if you have a class shape which is
inherited to Triangle, Square and Circle classes. Shape class has a method name as Draw which
will definitely inherited to all inherited class. Now, if you declare a variable of shape class and
initialize it with any of the inherited class it will call the method of inherited class.
Some other common definitions
1. One name many forms.
2. One interface multiple methods / ways.
Object Oriented
Software engineering approach that models a system as a
group of interacting objects.
Each object represents some entity of interest in the
system being modeled,
It uses class, its state (data elements), and its behavior.
Models shows
the static structure,
dynamic behavior, and
run-time deployment of these collaborating objects
Use of Unified Modeling Language Vs Descriptive
methodologies
Introduction to OOAD
Object Oriented Supports:
Encapsulation
Inheritance
Polymorphism
Abstraction
Object Oriented Analysis
Object-oriented analysis (OOA) applies object-modeling
techniques to analyze the functional requirements for a
system.
OOA focuses on what the system does.
Requirements/ domain analysis
Emphasis on finding and or describing objects in problem
domain
Examples
CMS
Library system
Object Oriented Design
Object-oriented design (OOD) elaborates the analysis
models to produce implementation specifications.
OOD on how the system does it.
Conceptual solution fulfilling requirements
Object/ database design
Emphasis on software object definition, and collaboration
to fulfill the requirements
Object oriented Vs Procedure oriented
PO Language is fully concentrates on Procedures/
functions/methods.
It normally works as a sequence of actions as seen in
flowchart or in any algorithm.
It follows top-down approach. It totally focuses on
methods and not the data which is utilized by methods.
Data shared among many method is declared as global
data
Chances of side effects