Académique Documents
Professionnel Documents
Culture Documents
Know This.
3
Hierarchy
Modularity
Encapsulation
Abstraction
Object Orientation
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
What is Encapsulation?
Hide implementation from clients
Clients depend on interface only!
Clients do not need to know how the server
operates or provides the services!
Improves Resiliency
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
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
What is Hierarchy?
Asset
Levels of abstraction
Increasing
abstraction
Security
BankAccount
Savings Checking
Decreasing
abstraction
Stock
Bond
RealEstate
Know This.
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
(unnamed object)
a + b = 10
ProfessorClark
Class Name Only
ProfessorClark :
Professor
Professor Clark
What is a Class?
A class is a description of a group of
objects with common properties (attributes),
behavior (operations), relationships, and
semantics
A class is an abstraction of objects.
An object is an instance of a class
OO Principle: Abstraction
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
11
Representing Classes
A class is represented using a
compartmented rectangle
(note: no underlining)
a + b = 10
Professor
Professor Clark
12
Professor
name
empID
create( )
save( )
delete( )
change( )
13
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
14
What is an Attribute?
Object
Class
Attribute
CourseOffering
Specific
attribute values
for different
objects
number
startTime
endTime
:CourseOffering
number = 101
startTime = 900
endTime = 1100
:CourseOffering
number = 104
startTime = 1300
endTime = 1500
15
CourseOffering
Class
Operation
addStudent
deleteStudent
getStartTime
getEndTime
16
What is a Component?
A non-trivial, nearly independent, and
replaceable part of a system that fulfills a
clear function in the context of a welldefined architecture
A component may be
A source code component
A run time component or
An executable component
Source File
Name
<<EXE>>
Executable
Name
17
OO Principle:
Encapsulation
Component
Interface
<<DLL>>
Component
Name
What is a Package?
A package is a general purpose mechanism for organizing like
elements into groups
A model element which can contain other model elements
Think: in the Java API, similar classes are found in packages that
we may import, etc.
Package Name
Uses
Organize the model under development
A unit of configuration management
OO Principle:
Modularity
Know This
18
FileReader
BufferedReader
FileWriter
PrinterWriter, etc.
19
What is a Subsystem?
A combination of a package (contains other model
elements) and a class (has behaviors)
A subsystem: realizes one or more interfaces which
define its behavior
Interface is an abstract class. Subsystems
implement (realize) the interface(s)
Realization
<<subsystem>>
Subsystem Name
Interface
Subsystem
Interface
20
Example of Subsystems
Realization
<<subsystem>>
Subsystem Name
Interface
Subsystem
Interface
Subsystem might be AccountsReceivable, AccountsPayable, Billing,
That is, a major hunk of functionality.
BUT, a client of the subsystem does NOT have access to the individu
Classes like in a Package. Rather, a client must go through the
public Interface to the subsystem, which contains the signatures of t
services provided within the subsystem.
The contents of the subsystem are NOT directly accesses;
They are protected;
Only the services shown in the interface are made available to clien
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
21
Relationships
Association
Aggregation
Composition
Dependency
Generalization
Realization
22
Relationships: Association
Professor
University
Works for
Association
Class
Role Names
University
Professor
Employee
23
Employer
Part
Schedule
Student
Know This
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
Relationships: Composition
A form of aggregation with strong
ownership and coincident lifetimes
The parts cannot survive the whole/aggregate
Part
Whole
Schedule
Student
Know This
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
Aggregation
This one is called
composition.
25
26
Association: Multiplicity
Unspecified
Exactly one
1
Zero or more (many, unlimited) 0..*
*
One or more
Zero or one
Specified range
Multiple, disjoint ranges
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
27
1..*
0..1
2..4
2, 4..6
Multiplicity
Student
0..*
Schedule
Navigation
28
Relationships: Dependency
Know This
Client
Class
Package
Supplier
Supplier
Client
Dependency
relationship
ClientPackage
Component
SupplierPackage
29
Dependency
relationship
Relationships: Generalization
30
Account
balance
name
number
Superclass
(parent)
Withdraw()
CreateStatement()
Generalization Relationship
Savings
Checking
Subclasses
GetInterest()
Withdraw()
Withdraw()
Descendents
31
Animal
multiple
inheritance
Airplane
Helicopter
Bird
Wolf
Horse
32
33
GroundVehicle
Superclass
(parent)
owner
weight
licenseNumber
0..*
Person
register( )
generalization
Subclass
Truck
Car
size
tonnage
getTax( )
34
Trailer
Subsystem
Interface
Canonical form
Use Case
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
Elided form
Use-Case Realization
35
37
4. Stereotypes
Classify/extend 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 or as
a different icon
<<boundary>>
MyBoundaryClass
MyBoundaryClass
38
Notes
A Note can be added to any UML element
The class diagram is the one most often
extended
MaintainScheduleForm
39
Tagged Values
Extensions of the properties, or specific
attributes, of a UML element
Some properties are defined by UML
Persistence
Location (e.g., client, server)
anObject : ClassA
{location=server}
40
Constraints
Supports the addition of new rules or
modification of existing rules
Professor
Member
1..*
Department Head
1
Department
{subset}
1
41
What is an Attribute?
What is an Operation?
What is an Interface?
What is Polymorphism?
What is a Component?
OOAD Using the UML - Introduction to Object Orientation, v 4.2
Copyright 1998-1999 Rational Software, all rights reserved
42
(continued)
Know This
43