Professional Documents
Culture Documents
A N A LY S IS A N D D ES IG N
U S IN G TH E U M L
V ER S IO N 4.2
O bjectives:Introduction to
O bject O rientation
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
Introduction to O bject
O rientation Topics
Basic Principles of Object Orientation
Basic Concepts of Object Orientation
Strengths of Object Orientation
General UML Modeling Mechanisms
Hierarchy
Modularity
Encapsulation
Abstraction
Object Orientation
W hat is Abstraction?
Salesperso
n
Customer
Not saying
Which
salesperso
n just a
salesperso
n in
general!!!
Manages Complexity
Product
W hat is Encapsulation?
Hide implementation from clients
Clients depend on interface
Improves Resiliency
W hat is M odularity?
The breaking up of something
Order
Fulfillment
Billing
Manages Complexity
W hat is H ierarchy?
Asset
Increasing
abstraction
Levels of abstraction
BankAccount
Savings Checking
Decreasing
abstraction
Security
Stock
Bond
RealEstate
Introduction to O bject
O rientation Topics
Basic Principles of Object Orientation
Basic Concepts of Object Orientation
Strengths of Object Orientation
General UML Modeling Mechanisms
W hat is an O bject?
Informally, an object represents an
Conceptual entity
Chemical Process
Software entity
Linked List
Representing O bjects
An object is represented as
ProfessorClark
Class Name Only
Professor Clark
:
Professor
Class and Object Name
Professor Clark
W hat is a Class?
A class is a description of a group of
OO Principle: Abstraction
a + b = 10
Behavior
Add a student
Delete a student
Get course roster
Determine if it is full
Representing Classes
A class is represented using a
compartmented rectangle
Professor
a + b = 10
Professor Clark
(attributes)
The third section shows the behavior
Class Name
Professor
(operations)
Attributes
Operations
name
empID
create( )
save( )
delete( )
change( )
object
It defines the structure and behavior of
Professor Mellon
Professor Jones
W hat is an Attribute?
Object
Class
Attribute
Attribute Value
:CourseOffering
CourseOffering
number = 101
startTime = 900
endTime = 1100
number
startTime
endTime
:CourseOffering
number = 104
startTime = 1300
endTime = 1500
W hat is an O peration?
CourseOffering
Class
Operation
addStudent
deleteStudent
getStartTime
getEndTime
Manufacturer A
OO Principle:
Encapsulation
Manufacturer B
Manufacturer C
W hat is an Interface?
Interfaces formalize polymorphism
Interfaces support plug-and-play
architectures
Tube
<<interface>>
Shape
Pyramid
Draw
Move
Scale
Rotate
Cube
Realization relationship
Interface Representations
Tube
Elided/Iconic
Representation
(lollipop)
Pyramid
Shape
Canonical
(Class/Stereoty
pe)
Representation
Cube
Tube
<<interface>>
Shape
Draw
Move
Scale
Rotate
Pyramid
Cube
(stay tuned for realization
<<EXE>>
Executable
Name
Component
Interface
<<DLL>>
Component
Name
W hat is a Package?
A package is a general purpose mechanism
Package Name
OO Principle:
Modularity
Uses
Organize the model under development
A unit of configuration management
W hat is a Subsystem ?
A combination of a package (can
<<subsystem>>
Subsystem Name
Interface
Subsystem
Interface
Component
Interface
Component
Name
Relationships
Association
Aggregation
Composition
Dependency
Generalization
Realization
Relationships:Association
Models a semantic connection
among
classes
Association Name
Professor
Works for
Association
Class
University
Role Names
University
Professor
Employee
Employer
Relationships:Aggregation
A special form of association that
Student
Aggregation
Relationships:Com position
A form of aggregation with strong
whole/aggregate
Part
Schedule
Student
Aggregation
participate in a relationships
The number of instances of one class related to
Association:M ultiplicity
Unspecified
Exactly one
1
0..*
*
Zero or more (many, unlimited)
1..*
One or more
Zero or one
Specified range
Multiple, disjoint ranges
0..1
2..4
2, 4..6
Student
Navigation
0..*
Schedule
Relationships:D ependency
A relationship between two model
Class
Package
ClientPackage
Supplier
Dependency
relationship
Component
Supplier
Client
SupplierPackage
Dependency
relationship
Relationships:G eneralization
A relationship among classes where one
Generalization is an is-a-kind of
relationship
Superclass
(parent)
Account
balance
name
number
Withdraw()
CreateStatement()
Generalization
Relationship
Subclasses
Checking
Savings
Withdraw()
GetInterest()
Withdraw()
Descendents
classes
FlyingThing
Animal
multiple
inheritance
Airplane
Helicopter
Bird
Wolf
Horse
relationships
Redefine inherited operations (use
caution!)
and/orleverages
relationships
are among
shown
at the
Inheritance
the similarities
classes
highest applicable level in the
Superclass
(parent)
weight
licenseNumber
owner
0..*
Person
register( )
generalization
Subclass
Car
size
Truck
tonnage
getTax( )
Trailer
Relationships:Realization
One classifier serves as the contract
Interface
Subsystem
Interface
Component
Interface
Elided form
Canonical form
UseUse
Case
seller
Salesperson
buyer
item sold
Customer
Corporate
Individual
Product
shipping mechanism
Vehicle
Truck
Train
Eff
ect ofRequirem ents Change
Suppose you need a
new type of shipping
vehicle ...
seller
Salesperson
Sale
buyer
item sold
Customer
Corporate
Individual
Product
Truck
shipping mechanism
Vehicle
Train
Airplane
Introduction to O bject
O rientation Topics
Basic Principles of Object Orientation
Basic Concepts of Object Orientation
Strengths of Object Orientation
General UML Modeling Mechanisms
Stereotypes
Classify and extend the UML
notational elements
Define a new model element in
terms of another model element
May be applied to all modeling
elements
Represented with name in guillemets
<<boundary>>
or as a different icon
MyBoundaryClass
MyBoundaryClass
Exam ple:Stereotypes
<<boundary>>
<<boundary>>
<<trace>>
DesignClass
<<Processor>>
Processor #1
Processor #1
N otes
A note can be added to any UML
element
Notes may be added to add more
information to the diagram
It is a dog eared rectangle
The note may be anchored to an
There can be up to one
element with a dashed
line
MaintainScheduleForm
per
MaintainScheduleForm
user session.
Tagged Values
Extensions of the properties, or
anObject : ClassA
{location=server}
Constraints
Supports the addition of new rules or
Member
1..*
Department Head
1
Department
{subset}
1