0% found this document useful (0 votes)
32 views29 pages

Object Oriented Analysis and Design Using The UML: Nabgha Hashmi Faculty of Computer Science University of Gujrat

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views29 pages

Object Oriented Analysis and Design Using The UML: Nabgha Hashmi Faculty of Computer Science University of Gujrat

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Object Oriented Analysis and Design

Using the UML

Nabgha Hashmi

Faculty of Computer Science

University of Gujrat
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 1
Objectives: Introduction to Object Orientation

 Understand the basic principles of object orientation

 Understand the basic concepts and terms of object orientation

and the associated UML notation

 Appreciate the strengths of object orientation

 Understand some basic UML modeling mechanisms

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 2
Introduction to Object Orientation Topics
 Basic Principles of Object Orientation
 Basic Concepts of Object Orientation
 Strengths of Object Orientation
 General UML Modeling Mechanisms

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 3
Basic Principles of Object Orientation

Object Orientation

Encapsulation
Abstraction

Modularity

Hierarchy
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 4
What is Abstraction?

Salesperson
Not saying Which
salesperson – just
a salesperson in
general!!!

Product
Customer

Manages Complexity
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 5
What is Encapsulation?
 Hide implementation from clients
 Clients depend on interface

How does an object encapsulate?


What does it encapsulate?

Improves Resiliency
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 6
What is Modularity?
 The breaking up of something complex into
manageable pieces
Order
Entry

Order Processing
System Order
Fulfillment

Billing

Manages Complexity
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 7
What is Hierarchy?
 Levels of abstraction Asset
Increasing
abstraction

BankAccount Security RealEstate

Savings Checking Stock Bond

Decreasing Elements at the same level of the hierarchy


abstraction should be at the same level of abstraction
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 8
Introduction to Object Orientation Topics
 Basic Principles of Object Orientation
 Basic Concepts of Object Orientation
 Strengths of Object Orientation
 General UML Modeling Mechanisms

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 9
Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface (Polymorphism)
 Relationships

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 10
Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface (Polymorphism)
 Relationships

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 11
What is an Object?
 Informally, an object represents an entity,
either physical, conceptual, or software
 Physical entity

Truck

 Conceptual entity
Chemical Process

 Software entity Linked List

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 12
A More Formal Definition
 An object is a concept, abstraction, or thing
with sharp boundaries and meaning for an
application
 An object is something that has:
 State
 Behavior
 Identity

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 13
Representing Objects
 An object is represented as rectangles with
underlined names

: Professor
a + b = 10

ProfessorClark
Class Name Only
Professor Clark
ProfessorClark :
Professor Object Name Only

Class and Object Name


(stay tuned for classes)
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 14
Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface (Polymorphism)
 Component
 Package
 Subsystem
 Relationships

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 15
What is a Class?
 A class is a description of a group of objects
with common properties (attributes),
behavior (operations), relationships, and
semantics
 An object is an instance of a class
 A class is an abstraction in that it:
 Emphasizes relevant characteristics
 Suppresses other characteristics

OO Principle: Abstraction
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 16
Sample Class

Class
Course
Properties Behavior
Name Add a student
Location Delete a student
a + b = 10
Days offered Get course roster
Credit hours Determine if it is full
Start time
End time

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 17
Representing Classes
 A class is represented using a
compartmented rectangle

a + b = 10
Professor

Professor Clark

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 18
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( )

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 19
Classes of Objects
 How many classes do you see?

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 20
The Relationship Between Classes and Objects
 A class is an abstract definition of an object
 It defines the structure and behavior of each
object in the class
 It serves as a template for creating objects
 Objects are grouped into classes
Objects Class

Professor

Professor Smith Professor Mellon

Professor Jones
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 21
Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface (Polymorphism)
 Relationships

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 22
What is an Attribute?

Object
Class

Attribute Attribute Value


:CourseOffering
number = 101
startTime = 900
CourseOffering endTime = 1100
number
startTime
endTime :CourseOffering
number = 104
startTime = 1300
endTime = 1500

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 23
Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface (Polymorphism)
 Relationships

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 24
What is an Operation?

CourseOffering
Class
addStudent
deleteStudent
getStartTime
Operation getEndTime

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 25
Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface (Polymorphism)
 Relationships

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 26
What is Polymorphism?
 The ability to hide many different
implementations behind a single interface

Manufacturer B
Manufacturer A Manufacturer C

OO Principle:
Encapsulation

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 27
What is an Interface?
 Interfaces formalize polymorphism
 Interfaces support “plug-and-play”
architectures
Tube
<<interface>>
Shape
Pyramid
Draw
Move
Scale
Rotate Cube

Realization relationship (stay tuned for realization relationships)


OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright  1998-1999 Rational Software, all rights reserved 28
Basic Concepts of Object Orientation
 Object
 Class
 Attribute
 Operation
 Interface (Polymorphism)
 Relationships

(Next Class)

OOAD Using the UML - Introduction to Object Orientation, v 4.2


Copyright  1998-1999 Rational Software, all rights reserved 29

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy