Unit – 1 (Introduction to OOAD)
• An overview of object oriented systems
development.
• Object basics
• object oriented systems development life
cycle
Important Programming Models
• Procedure Oriented Algorithms
• Object Oriented Classes & Objects
Algorithm Analysis
[Link] efficiency
[Link] efficiency
2.1 Worst case efficiency
2.2 Best case efficiency
2.3 Average case efficiency
Algorithm analysis (Continued…)
1. Worst case efficiency
It is the efficiency for worst case input ( worst case
input is the one for which the algorithm runs longest).
2. Best case efficiency
It is the efficiency for best case input ( best case input is
the one for which the algorithm runs fastest).
3. Average case efficiency
It is the efficiency for Average case input
Algorithm analysis (Continued…)
Case 1:
If the algorithm is depending only on the input size ,
we need not to find best,worst and average case efficiencies
separately.
Case 2:
If the algorithm is depending not only on the input
size ,but also some factors then find we have to fine
worst,best and average case efficiencies separately.
• Differentiate OOP, OOA & OOD.
Object Oriented Programming
• A language is object oriented if and only if
it satisfies the following requirements:
[Link] objects
[Link] have a class
[Link] may inherit attributes from super class.
Object Oriented Analysis
• It is a method of analysis that examines
requirements from the users.
….contd
Object Oriented Design
• It leads to an object –oriented
decomposition.
• Uses different notations to express
different models.
Introduction
• System development refers to all activities that
produces the solution.
• System development activities consists of
analysis, modeling, design, implementation, testing &
maintenance.
• A software development methodology is a
series of processes that, if followed , can lead to the
development of an application.
Object Model
• The main principles of object model are
a) abstraction
b) encapsulation
c) modularity
d) hierarchy
e) typing
f) concurrency
g) persistence
Major Elements of Object Model
a) abstraction
b) encapsulation
c) modularity
d) hierarchy
Minor Elements of Object Model
a) typing
b) concurrency
c) persistence
a) What is Abstraction?
• It focuses upon the essential characteristics of
objects.
• (e.g.) Project Abstract
b) What is Encapsulation?
• Hides the details of the implementation (data &
procedure) of an object
(e.g.) Hides the details of the implementation from
clients.
- Provides the interface.
c) What is Modularity?
• The breaking up of something complex
into manageable pieces
Effective Modular design
[Link]
[Link]
d-1) What is Hierarchy?
• Ranking or Ordering of abstraction
Increasing
abstraction Vehicle
Car
Ford
Decreasing Mustang Taurus Thunderbird
abstraction
Elements at the same level of the hierarchy
should be at the same level of abstraction
d-2) What is Hierarchy?
• At the top of the hierarchy are the most
general classes.
• At the bottom are the most specific.
• A subclass inherits all of the properties &
methods from the superclass.
e) Typing
• It is the enforcement of the class of an
object, such that objects different types
may not be interchanged, or at the most ,
they may be interchange only in very
restricted ways.
• Strong typing prevents mixing
abstractions.
f) Concurrency
• It allows different objects to act at the
same time.
• It’s the property that distinguishes an
active object from one that is not active.
g) Persistence
• It is the property of an object through
which the object continues exists after its
creator ceases to exists and / or the
objects location moves from the address
phase in which it was created.
Basic Concepts of Object
Orientation
• Object
• Class
• Attribute (Property)
• Method (Procedure)
• Inheritance
• Interface (Polymorphism)
• Relationships
1a) What is an Object?
• It is a combination of data & logic that
represents some real world entity, either
physical, conceptual, or software
– Physical entity (e.g.) car
– Conceptual entity (e.g.) chemical process
Software entity (e.g.) linked list
1b) Representing Objects
• An object is represented as rectangles
with underlined names
: Professor
ProfessorNandhini
Class Name Only
Professor Nandhini
ProfessorNandhini: Object Name Only
Professor
Class and Object Name
2a) What is a Class?
• A class is a set of objects with common
properties (attributes), behavior (operations),
and relationships
- An object is an instance of a class
2b) Representing Classes
• A class is represented using a
compartmented rectangle
a + b = 10
Professor
ProfessorRani
2c) Class Compartments
• A class is comprised of three sections
– The first section contains the class name
– The second section shows the structure
(attributes)
– The third section shows the behavior
(operations)
Class Name Professor
name
Attributes empID
Operations create( )
save( )
delete( )
change( )
2d)The Relationship Between
Classes and Objects
• Objects are grouped into classes
Objects Class
Professor
Professor Smith Professor Mellon
Professor Jones
3 What is an Attribute?
• Another name – properties
• It describe the state (data) of an object.
• Example
Class
Car
Cost
Attributes
Color
Manufacturer
Model
4) What is method (or) procedure?
• Define its behavior (what an object is
capable of doing).
CourseOffering
Class
addStudent
deleteStudent
getStartTime
Operation getEndTime
5a) Inheritance
• It allows objects to be built from other
objects.
• It is a relationalship between classes.
(one class is the parent of other (derived)
class.
• The parent class is also known as the
base class (or) superclass.
5b) Example: Single Inheritance
• One class inherits from another
Ancestor
Account
Superclass balance
(parent) name
number
Withdraw()
CreateStatement()
Generalization
Relationship
Checking Savings
Subclasses Withdraw() GetInterest()
Withdraw()
Descendents
5c) Multiple Inheritance
• Some OO systems permit a class to inherit its
state (attributes) and behaviors from more than
one super class.
Vehicle
Truck Car Bus
Utility Vehicle
5d) Example: Multiple Inheritance
• A class can inherit from several other
classes
FlyingThing Animal
multiple
inheritance
Airplane Helicopter Bird Wolf Horse
Use multiple inheritance only when needed, and
always with caution !
6) What is Polymorphism ?
• Poly means “many”
• Morph means “form”
• Polymorphism the same operation may
behave differently on different classes.
• Booch defines Polymorphism as the
relationship of objects of many different classes
by some common superclass.
7a) Relationships
• Association
– Aggregation
• Dependency
• Generalization
• Realization
7b)Relationships: Association
• It represents the relationships between objects &
classes.
Association Name
Professor Works for University
Association
Role Names
Class Professor University
Employee Employer
7c)Relationships: Association
• It is rendered as a solid line.
• It has a name & a role.
Name Direction
ASSOCIATION NAMES
Name
Works for
Person Company
Association
Association Role Name
ROLES
Person Company
Employee Employer
7d)Relationships: Aggregation
• A special form of association that models a
whole-part relationship between an
aggregate (the whole) and its parts
7e) Relationships: Aggregation
• (e.g.)
Whole Part
College Department
Aggregation
7f) Relationships: Aggregation
• (e.g.) a car object of other objects such as
engine, seat and wheel objects.
Car
Engine Seat wheel
7g) Relationships: Dependency
• A relationship between two model elements where a
change in one may cause a change in the other
• Non-structural, “using” relationship
Class Client Supplier
Dependency relationship
7h) Relationships: Generalization
• It is a relationship between a general thing
(called the superclass or parent) & a more
specific kind of that thing (called the
subclass or child)
• Generalization is an “is-a-kind of”
relationship
7j) Relationships: Generalization
Shape
Base class
origin
move( )
resize( )
Generalization display( )
Rectangle Circle Polygon
Corner : Point Corner : Point Points : List
Display
Square Leaf class
7k) Relationships: Realization
b) It is used for tracebility
Canonical form
Use Case Use-Case Realization
8) Review: Introduction to Object Orientation
• What are the four basic principles of object
orientation? Provide a brief description of each.
• What is an Object and what is a Class? What is the
difference between them?
• What is an Attribute?
• What is an Operation?
• What is an Interface? What is Polymorphism?
• Name the 4 basic UML relationships and describe
each.
• Describe the strengths of object orientation.
(continued)
Software Development Life
Cycle
• System development refers to all activities that
produces the solution.
• System development activities consists of
analysis, modeling, design, implementation, testing &
maintenance.
• A software development methodology is a
series of processes that, if followed , can lead to the
development of an application.
2e) Software Development Process
– Linear Sequential Model (Or) Waterfall model
– Prototyping model
– Evolutionary Model
• Incremental model
• Spiral model
• WIN - WIN model
– Object oriented model
Linear Sequential Model
System/information
engineering
analysis design code test
(e.g.) The waterfall software development process
What
How
Do It
Test
Use
Prototyping Model
Customer
Communication Quick Design
Customer
evaluation of Build
Prototype Prototype
Incremental Model
increment 1
analysis design code test delivery of
1st increment
analysis design code test delivery of
increment 2
2nd increment
increment 3 analysis design code test delivery of
3rd increment
increment 4 analysis design code test
delivery of
4th increment
calendar time
Spiral Model
Pla nn in g
Risk Ana lysis
C usto m e r
Co m m unic a tio n
Eng ine e ring
C usto m e r
Eva lua tio n Co nstruc tio n & Re le a se
3a) OO System Development : A Usecase
Driven Approach
Build a Use-Cases
model
Object analysis
Validate test
Using CASE Design classes,defne Build object
TOOLs User attributes and methods model
and/or OO satisfaction &
programming Quality test User satisfaction Build User Interface
languages
& Quality test & Prototype
3b) OO System Development : A
Usecase Driven Approach
• OO System Development includes the
following activities:
– OO Analysis
– OO Design
– Prototyping
– Component based development
– Testing
4c) OO Analysis
• OO analysis includes the following
activities:
– Determining the system requirements.
– Identifying classes and their relationship to
other class in the problem domain.
4d) OO Design
• OO Design includes the following
activities:
– Design the classes.
– Design the user interface
4e) OO Design - Guidelines
– Reuse rather than build a new class.
– Design a large no. of simple classes rather
than a small no. of complex classes.
– Design methods.
– Critique what you have proposed. If
possible, go back & refine the classes.
4f) Prototyping
• A version of a software product developed
in the early stage of the products life cycle
for specific, experimental purposes.
• Easy to understand
• Types of Prototyping
[Link] ended (or) Throwaway
[Link] ended (or) Evolutionary
4g) Testing
[Link] box testing
[Link] box Testing
THANK YOU!