8/12/2019 Um l Presentation
1/93
1
Unified Modeling Language
Prof.K.Phani KumarICFAI School of IT, Hyderabad
8/12/2019 Um l Presentation
2/93
2
Agenda What is Model? Why do we Model?
Importance of Modeling? Four principles of Modeling? UML History of the UML
UML DiagramsActivity Diagram Use Case Diagram Sequence Diagram
Collaboration Diagram Class Diagram State Diagram Component Diagram Deployment Diagram
8/12/2019 Um l Presentation
3/93
3
What Is a Model?
A model is a simplification of reality.
8/12/2019 Um l Presentation
4/93
4
Why Do We Model?
Modeling achieves four aims: Helps us to visualize a system as we want it to be. Permits us to specify the structure or behavior of a
system.
Gives us a template that guides us in constructing a
system. Documents the decisions we have made.
We build models of complex systems because wecannot comprehend such a system in its entirety.
We build models to better understand the systemwe are developing.
8/12/2019 Um l Presentation
5/93
5
The Importance of Modeling
Paper Airplane Fighter Jet
Less Important More Important
8/12/2019 Um l Presentation
6/93
6
The Importance of Modeling
8/12/2019 Um l Presentation
7/937
Who Should Model?
Requirementsand
BusinessModels
HTMLCGIXML
JavaScript
Data Models
C++Java
SW ModelsSoftwareEngineer
DatabaseDesigner
Web ContentDeveloper
BusinessAnalyst
8/12/2019 Um l Presentation
8/93
8
Software Teams Often Do Not Model
Many software teams build applications
approaching the problem like they were buildingpaper airplanes Start coding from project requirements
Work longer hours and create more code
Lacks any planned architecture Doomed to failure
Modeling is a common thread to successfulprojects.
8/12/2019 Um l Presentation
9/93
9
Four Principles of Modeling
The model you create influences how the
problem is attacked. Every model may be expressed at different
levels of precision.
The best models are connected to reality. No single model is sufficient.
8/12/2019 Um l Presentation
10/93
10
Principle 1: The Choice of Model Is Important
The models you create profoundly
influence how a problem is attackedand how a solution is shaped. In software, the models you choose
greatly affect your world view.
Each world view leads to a differentkind of system.
Deployment Diagram
Process Model
Design Model
8/12/2019 Um l Presentation
11/93
11
Principle 2: Levels of Precision May Differ
Every model may be expressed at different
levels of precision. The best kinds of models let you choose your
degree of detail, depending on:
who is viewing the model. why they need to view it.
View for Designers View for Customers
8/12/2019 Um l Presentation
12/93
12
Principle 3: The Best Models Are Connected to Reality
All models simplify reality.A good model reflects potentially fatal
characteristics.
8/12/2019 Um l Presentation
13/93
13
Principle 4: No Single Model Is Sufficient
No single model is sufficient. Every non-trivial
system is best approached through a small set ofnearly independent models. Create models that can be built and studied separately,
but are still interrelated.
Process View Deployment View
Logical View
Use-Case View
Implementation View
End-userFunctional i ty
ProgrammersSoftware management
Performancescalabi l i tyth roughput
System integrators
System topo logydel ivery, ins tal lat ion
communicat ion
System engineering
Analysts/Designers
Structure
8/12/2019 Um l Presentation
14/93
14
What is the UML?
The UML is thestandardlanguage forvisualizing,specifying,constructing,anddocumentingthe artifacts of a
software-intensivesystem
8/12/2019 Um l Presentation
15/93
15
Inputs to the UML
Fusion
Operation descriptions,message numbering
Fusion
Operation descriptions,
Meyer
Before and after
conditions
Meyer
Harel
State charts
Harel
State charts
Wirfs-Brock
Responsibilities
Wirfs-Brock
Responsibilities
Embley
Singleton classes,
high-level view
Embley
Singleton classes,
-level view
Odell
Classification
Odell
Classification
Shlaer -Mellor
Object lifecycles
Shlaer -Mellor
Gamma, et.al
Frameworks, patterns,notes
Gamma, et.al
Frameworks, patterns,notes
BoochRumbaugh Jacobson
8/12/2019 Um l Presentation
16/93
16
History of the UML
Web - June 1996 UML 0.9
Unified Method 0.8OOPSLA 95
UML 1.0UML partners
OMG Acceptance, Nov 1997
Final submission to OMG, Sept 1997First submission to OMG, Jan 1997 UML 1.1
UML 2.0Planned major revision (2002)
OMTBooch method
Public
Feedback
OOSEOther methods
Approved minor revision 2001 UML 1.4
Current minor revision 1999 UML 1.3
8/12/2019 Um l Presentation
17/93
17
What Is the UML?
The UML is a language for Visualizing Specifying Constructing
Documentingthe artifacts of a software-intensive system.
8/12/2019 Um l Presentation
18/93
18
The UML Is a Language for Visualizing
Communicating conceptual
models to others is prone toerror unless everyoneinvolved speaks the samelanguage.
There are things about asoftware system you cantunderstand unless you buildmodels.
An explicit model facilitatescommunication.
8/12/2019 Um l Presentation
19/93
19
The UML Is a Language for Specifying
The UML builds models that are precise,
unambiguous, and complete.
8/12/2019 Um l Presentation
20/93
20
The UML Is a Language for Constructing
UML models can be directly connected to a
variety of programming languages.Maps to Java, C++, Visual Basic, and so on
Tables in a RDBMS or persistent store in an
OODBMSPermits forward engineering
Permits reverse engineering
8/12/2019 Um l Presentation
21/93
21
The UML Is a Language for Documenting
Forward Engineering(Code Generation) and
Reverse Engineering
DomainExpert
User InterfaceDefinition
Use CaseDiagram
Actor A
Use Case 1
Use Case 2
Use Case 3
Actor B
Activity Diagram
[yes]
Actor A Actor B
Class Diagram
GrpFile
read( )open( )create( )fillFile( )
rep
Repository
name:char *= 0
readDoc( ) readFile( )
(fromPersistence)
FileMgr
fetchDoc( )sortByName( )
DocumentList
add( )
delete( )
Document
name:int
docid:intnumField:int
get( ) open( )
close( )read( )
sortFileList( ) create( )
fillDocument( )
fList
1
FileList
add( )delete( )
1
File
read( )
read() fill the code..
State TransitionDiagram
Openning
Writing
Reading Closing
addfile[numberOffile==MAX]/
flag OFF
addfile
closefile
closefile
Component Diagram
Document
Repository
FileList
FileManager
GraphicFile File
Collaboration Diagram
user :
mainWnd: MainWnd
fileMgr : FileMgr
repository : Repositorydocument: Document
gFile: GrpFile
9:sortByName( )
L1:Doc view request( )
2:fetchDoc( )
5:readDoc ( )
7:readFile( )
3:create( )
6:fillDocument( )
4:create( )
8:fillFile( )
Sequence Diagram
usermainWnd fileMgr :
FileMgrrepository document:
DocumentgFile
1:Docview request( )
2:fetchDoc( )
3:create( )
4:create( )
5:readDoc ( )
6:fillDocument( )
7:readFile( )
8:fillFile( )
9:sortByName( )
.
.
.
The UML addresses documentation of system architecture,requirements, tests, project planning, and release
management.
Modelspace
Executable System
DeploymentDiagram
Window95
.EXE
WindowsNT
.EXE
Windows NT
Windows95
Solaris
.EXE
AlphaUNIX
IBMMainframe
Windows95
- 95:- NT:
- : ,- IBM : ,
Forward Engineering(Code Generation) and
Reverse Engineering
Source Codeedit, compile,debug, link
19
8/12/2019 Um l Presentation
22/93
22
What Type of Process Most Benefits the UML?
The UML is largely process independent. A
process fully benefits from the UML whenthe process is:Use-case driven
Architecture-centric Iterative and incremental
IterationandReuseBuild use-casemodel
Validate/ Test
O-O Analysis
BuildUse-Cases
Design classes,defineattributes andmethods
O-O Design
O-O
Implementation
Using TOOLSCASE and/orOO programinglanguages
UsersatisfactionUsability &QA Tests
Build object& dynamicmodel
Objectanalysis
Build UIandprototype
User satisfaction test,usability testquality assurance test
Validate/test
8/12/2019 Um l Presentation
23/93
23
A Use-Case Driven Process
Use cases defined for a system are the
basis for the entire development process. Benefits of use cases:
Concise, simple, and understandable by a wide rangeof stakeholders.
Help synchronize the content of different models.
Withdraw MoneyWithdraw Money
CustomerCustomer
Check BalanceCheck Balance
C
8/12/2019 Um l Presentation
24/93
24
An Architecture-Centric Process
A systems architecture is used as a
primary artifact for conceptualizing,constructing, managing, and evolving thesystem under development.
Benefits: Intellectual control over a project to manage its
complexity and to maintain system integrity.
Effective basis for large-scale reuse.
A basis for project management.Assistance in component-based development.
A I i d I l P
8/12/2019 Um l Presentation
25/93
25
An Iterative and Incremental Process
Critical risks are resolved before making
large investments. Initial iterations enable early user feedback. Testing and integration are continuous.
Objective milestones focus on the shortterm. Progress is measured by assessing
implementations. Partial implementations can be deployed.
It ti D l t
8/12/2019 Um l Presentation
26/93
26
Iterative Development
Earliest iterations address greatest risks. Each iteration produces an executable
release, an additional increment of thesystem. Each iteration includes integration and test.
T I M E
Iteration 1 Iteration 2 Iteration 3
I
C
DR
TI
C
DR
T
I
C
DR
T
UML Di
8/12/2019 Um l Presentation
27/93
27
UML Diagrams
Use case Activity Sequence Collaboration
Class State chart Object Component Deployment
8/12/2019 Um l Presentation
28/93
28
Wh t I S t B h i ?
8/12/2019 Um l Presentation
29/93
29
What Is System Behavior?
System behavior is how a system acts and
reacts. It is the outwardly visible and testable activity of
a system.
System behavior is captured in use cases.Use cases describe the system, itsenvironment, and the relationship between thesystem and its environment.
Wh t I U C M d l?
8/12/2019 Um l Presentation
30/93
30
What Is a Use-Case Model?
A model that describes asystems functionalrequirements in terms ofuse cases.
A model of the systems
intended functions (usecases) and itsenvironment (actors).
Student
View Report Card
Register for Courses
Login
Wh t A th B fit f U C M d l?
8/12/2019 Um l Presentation
31/93
31
What Are the Benefits of a Use-Case Model?
Used to communicate with the end users and
domain experts Provides buy-in at an early stage of system
development
Insures a mutual understanding of the requirements
Used to identify Who interacts with the system and what the system
should do
The requirements for the system interfaces
Used to verifyAll requirements have been captured
The development team understands the requirements
M j C t i U C M d li
8/12/2019 Um l Presentation
32/93
32
Major Concepts in Use-Case Modeling
An actor represents anything
that interacts with the system.A use case defines a set of
use-case instances, whereeach instance is a sequenceof actions a system performsthat yields an observableresult of value to a particularactor.
Actor
Use Case
Wh t I A t ?
8/12/2019 Um l Presentation
33/93
33
What Is an Actor?
Actors are not part of the system. Actors represent roles a user of
the system can play. They can represent a human, a
machine, or another system. They can actively interchange
information with the system. They can be a giver of information. They can be a passive recipient of
information.
Ac tors are EXTERNAL.
Actor
Wh t I U C ?
8/12/2019 Um l Presentation
34/93
34
What Is a Use Case?
Use Case
Defines a set of use-case instances, where
each instance is a sequence of actions asystem performs that yields an observableresult of value to a particular actor.A use case models a dialogue between one or
more actors and the systemA use case describes the actions the system
takes to deliver something of value to the actor
Use Cases and Actors
8/12/2019 Um l Presentation
35/93
35
Use Cases and Actors
A use case models a dialog between actors
and the system.A use case is initiated by an actor to invoke
a certain functionality in the system.
Actor Use Case
Communicate-association
How Would You Read This Diagram?
8/12/2019 Um l Presentation
36/93
36
How Would You Read This Diagram?
Course Catalog
View Report Card
Register for Courses
Submit Grades
Select Courses to Teach
Student
Professor
Billing System
Maintain Student Information
Maintain Professor Information
Login
Close Registration
Registrar
Use Case Diagram Example
8/12/2019 Um l Presentation
37/93
37
Use Case Diagram Example
Use Case Diagram Example for College Registration
System
A student may register for classes during a specified
registration period. To register, a
student must see their advisor. The advisor must
approve each course that the student has
selected. The advisor will use the registration systemto determine if the student has met
the course prerequisites, is in good academic
standings and is eligible to register.
8/12/2019 Um l Presentation
38/93
38
If the advisor approves the courses, the advisor
enters the student's college id into the courseregistration system. The course registration number
for each course is entered. The
course description, course number and section forthose courses will automatically
display. The system will check for schedule conflicts
before saving the registrations. Abill for the courses will print in the Bursar's office.
The student should proceed to pick it
up.
8/12/2019 Um l Presentation
39/93
39
Faculty can use the registration system to check
enrolments in their classes, get a class list, check a
student's transcript, look up a student's phone number andother such student information. The registrar can use the
registration system to enter new classes for an upcoming
semester, cancel a class, and check conflicts inclassroom/faculty assignments. Admissions use the
registration system to add new students. Enrolment
services use the registration system to report on retention,update student information, and check fulfilment of
graduation requirements for those students planning to
graduate.
8/12/2019 Um l Presentation
40/93
40
What Is an Activity Diagram?
8/12/2019 Um l Presentation
41/93
41
What Is an Activity Diagram?
An activity diagram in the use-case model can be
used to capture the activities in a use case. It is essentially a flow chart, showing flow of
control from activity to activity.
Flow of Events
This use case starts when the Registrar requeststhat the system close registration.
1.The system checks to see if registration is in
progress. If it is, then a message is displayed to
the Registrar and the use case terminates. The
Close Registration processing cannot be
performed if registration is in progress.
2. For each course offering, the system checks if
a professor has signed up to teach the course
offering and at least three students have
registered. If so, the system commits the course
offering for each schedule that contains it.
What Is an Activity State?
8/12/2019 Um l Presentation
42/93
42
What Is an Activity State?
An activity state is an ongoing nonatomic
execution thatCan be decomposed.
May be interrupted and take some time tocomplete.
An activity state represents theperformance of an activity or step within theworkflow.
Example: Activity Diagram
8/12/2019 Um l Presentation
43/93
43
Example: Activity Diagram
Activity State
Synchronization Bar (Fork)
Guard Condition Synchronization Bar (Join)
Decision
Concurrent threads
Transition
SelectCourse
CheckSchedule
CheckPre-requisites
Assign tocourse
Resolveconflicts
Updateschedule
[ student added to the course ]
[ add course ]
Delete Course[ delete course ]
[ checks completed ] [ checks failed ]
Swimlanes
8/12/2019 Um l Presentation
44/93
44
Swimlanes
DetermineNeed
Take Order
Setup Payment
Deliver Order
Fill Order
FulfillmentSales
Objectives
8/12/2019 Um l Presentation
45/93
45
Objectives
Describe dynamic behavior and show how
to capture it in a model. Demonstrate how to read and interpret
a collaboration diagram.
a sequence diagram. Explain the similarities and differences
between collaboration and sequencediagrams.
Objects Need to Collaborate
8/12/2019 Um l Presentation
46/93
46
Objects Need to Collaborate
Objects are useless unless they can
collaborate to solve a problem.Each object is responsible for its own behavior
and status.
No one object can carry out every responsibilityon its own.
How do objects interact with each other? They interact through messages.
Objects Interact with Messages
8/12/2019 Um l Presentation
47/93
47
Objects Interact with Messages
The UML says: A message
is the specification of acommunication amongobjects that conveysinformation with the
expectation that activity willensue.A message says how one
object asks another object to
perform an operation.
What Is an Interaction Diagram?
8/12/2019 Um l Presentation
48/93
48
What Is an Interaction Diagram?
An interaction diagram shows an
interaction, consisting of a set of objectsand their relationships, including themessages that may be dispatched amongthem.
It models the dynamic aspects of a system.
Sequence Diagrams Collaboration Diagrams
What Is a Sequence Diagram?
8/12/2019 Um l Presentation
49/93
49
What Is a Sequence Diagram?
A sequence diagram is an interaction
diagram that emphasizes the time orderingof messages. The diagram shows
The objects participating in the interaction.
The sequence of messages exchanged.
Sequence Diagrams
Example: Sequence Diagram
8/12/2019 Um l Presentation
50/93
50
Example: Sequence Diagram
: Student::RegisterForCoursesForm ::RegistrationController : Course Catalog::CourseCatalogSystem
1: create schedule( )
5: display course offerings( )
2: get course offerings( )
3: get course offerings(forSemester)
6: display blank schedule( )
4: get course offerings( )
Sequence Diagram Contents: Objects
8/12/2019 Um l Presentation
51/93
51
Sequence Diagram Contents: Objects
::RegisterForCoursesForm ::RegistrationController SWTSU Catalog :
CourseCatalogSystem
Anonymous Objects
Lifelines
Named Object
Sequence Diagram Contents: Actor
8/12/2019 Um l Presentation
52/93
52
Sequence Diagram Contents: Actor
:RegisterForCoursesForm :RegistrationController SWTSU Catalog :CourseCatalogSystem
: Student : Course Catalog
Actor instances
Sequence Diagram Contents: Messages
8/12/2019 Um l Presentation
53/93
53
Sequence Diagram Contents: Messages
:RegisterForCoursesForm ::RegistrationController SWTSU Catalog :CourseCatalogSystem
: Student : Course Catalog
1: create schedule( )
2: get course offerings( )
3: get course offerings(for Semester)
4: get course offerings( )
5: display course offerings( )
6: display blank schedule( )Message
ReflexiveMessages
Sequence Diagram Contents: Focus of Control
8/12/2019 Um l Presentation
54/93
54
Sequence Diagram Contents: Focus of Control
:RegisterForCoursesForm :RegistrationControllerSWTSU Catalog :CourseCatalogSystem
: Student : Course Catalog
1: create schedule( )
2: get course offerings( )
3: get course offerings(forSemester)
4: get course offerings( )
5: display course offerings( )
6: display blank schedule( )
Focus of Control
What Is a Collaboration Diagram?
8/12/2019 Um l Presentation
55/93
55
What Is a Collaboration Diagram?
A collaboration diagram emphasizes the
organization of the objects that participatein an interaction. The collaboration diagram shows:
The objects participating in the interaction. Links between the objects.
Messages passed between the objects.
Collaboration Diagrams
Example: Collaboration Diagram
8/12/2019 Um l Presentation
56/93
56
Example: Collaboration Diagram
: Student
: RegisterForCoursesForm
: RegistrationController : CourseCatalogSystem
5: display course offerings( )6: display blank schedule( )
: Course Catalog
1: create schedule( )
2: get course offerings( )
3: get course offerings(forSemester)
4: get course offerings( )
Collaboration Diagrams Contents: Objects
8/12/2019 Um l Presentation
57/93
57
Collaboration Diagrams Contents: Objects
Objects
: RegisterForCoursesForm
: RegistrationControllerSWTSU Catalog: CourseCatalogSystem
Collaboration Diagram Contents: Actors
8/12/2019 Um l Presentation
58/93
58
Collaboration Diagram Contents: Actors
: Student
: Course Catalog
: RegisterForCoursesForm
: RegistrationControllerSWTSU Catalog: CourseCatalogSystem
Collaboration Diagram Contents: Links and Messages
8/12/2019 Um l Presentation
59/93
59
Collaboration Diagram Contents: Links and Messages
: Student
: RegisterForCoursesForm
: RegistrationController : CourseCatalogSystem
5: display course offerings( )6: display blank schedule( )
: Course Catalog
1: create schedule( )
2: get course offerings( )
3: get course offerings(forSemester)
4: get course offerings( )
Sequence and Collaboration Diagram Similarities
8/12/2019 Um l Presentation
60/93
60
Sequence and Collaboration Diagram Similarities
Semantically equivalentCan convert one diagram to the other without
losing any information
Model the dynamic aspects of a system
Model a use-case scenario
Sequence and Collaboration Diagram Differences
8/12/2019 Um l Presentation
61/93
61
Sequence and Collaboration Diagram Differences
Collaboration
diagrams Show relationships in
addition to interactions
Better for visualizingpatterns of collaboration
Better for visualizing allof the effects on a givenobject
Easier to use for
brainstorming sessions
Sequence
diagrams Show the explicit
sequence of messages
Better for visualizing
overall flow Better for real-time
specifications and forcomplex scenarios
Objectives
8/12/2019 Um l Presentation
62/93
62
Objectives
Describe the static view of the system and
show how to capture it in a model. Demonstrate how to read and interpret a
class diagram.
Model an association and aggregation andshow how to model it in a class diagram. Model generalization on a class diagram.
What Is a Class Diagram?
8/12/2019 Um l Presentation
63/93
63
g
Static view of a system
CloseRegistrationForm
+ open()+ close registration()
Student
+ get tuition()+ add schedule()+ get schedule()+ delete schedule()+ has pre-requisites()
Schedule- semester
+ commit()+ select alternate()+ remove offering()+ level()+ cancel()+ get cost()+ delete()+ submit()+ save()+ any conflicts?()+ create with offerings()+ update with new selections()
Professor- name- employeeID : UniqueId- hireDate
- status- discipline- maxLoad
+ submitFinalGrade()+ acceptCourseOffering()+ setMaxLoad()
+ takeSabbatical()
CloseRegistrationController
+ is registration open?()+ close registration()
Class Diagram Usage
8/12/2019 Um l Presentation
64/93
64
g g
When modeling the static view of a system,
class diagrams are typically used in one ofthree ways, to model: The vocabulary of a system.
Simple collaborations.
A logical database schema.
Example: Class Diagram
8/12/2019 Um l Presentation
65/93
65
p g
Is there a better way to organize class diagrams?
CloseRegistrationForm
LoginForm
Professor
BillingSystem
CloseRegistrationController
RegisterForCoursesForm
Course
CourseCatalogSystem
Student
nameaddressstudentID
RegistrationController
CourseOffering
Schedule
Review: What Is a Package?
8/12/2019 Um l Presentation
66/93
66
A general purpose mechanism for
organizing elements into groups.A model element that can contain othermodel elements.
A package can be used: To organize the model under development.As a unit of configuration management.
g
University
Artifacts
Example: Registration Package
8/12/2019 Um l Presentation
67/93
67
p g g
Registration
CloseRegistrationForm CloseRegistrationController
RegisterForCoursesForm RegistrationController
What Is an Association?
8/12/2019 Um l Presentation
68/93
68
The semantic relationship between two or
more classifiers that specifies connectionsamong their instances.A structural relationship specifying that
objects of one thing are connected to
objects of another.
Course
Student
Schedule
Example: What Associations Can You Find?
8/12/2019 Um l Presentation
69/93
69
p
:CourseOffering
: Student : RegistrationController
:Schedule
:Student
:PrimaryScheduleOfferingInfob
8: any conflicts?( )
: RegisterForCoursesForm
2: submit schedule( )
4: submit( )3: save( )
7: still open?( )9: add student(Schedule)
5: is selected?( )10: mark as enrolled in( )
6: has pre-requisites(CourseOffering)
1: submit schedule( )
: Student
What Is Multiplicity?
8/12/2019 Um l Presentation
70/93
70
p y
Multiplicity is the number of instances one class
relates to ONE instance of another class. For each association, there are two multiplicity
decisions to make, one for each end of theassociation.
For each instance of Professor, many Course Offeringsmay be taught.
For each instance of Course Offering, there may beeither one or zero Professor as the instructor.
Professor
CourseOffering
0..1 0..*0..1 0..*
instructor
Multiplicity Indicators
8/12/2019 Um l Presentation
71/93
71
p y
2..4
0..1
1..*
0..*
1
*
Unspecified
Exactly one Zero or more (many,
unlimited)
One or more Zero or one (optional
scalar role) Specified range Multiple, disjoint
ranges 2, 4..6
Example: Multiplicity
8/12/2019 Um l Presentation
72/93
72
p p y
RegisterForCoursesForm
CourseOffering
Schedule
0..*0..4
0..*0..4
Student
0..*1 0..*1
RegistrationController
1 11 1
0..1
0..1
0..1
0..1
What Is Aggregation?
8/12/2019 Um l Presentation
73/93
73
gg g
An aggregation is a special form of
association that models a whole-partrelationship between an aggregate (thewhole) and its parts.An aggregation is an is a part-of relationship.
Multiplicity is represented like otherassociations.
PartWhole
0..111 0..*
Example: Aggregation
8/12/2019 Um l Presentation
74/93
74
RegisterForCoursesForm
CourseOffering
Schedule
0..*0..4
0..*0..4
Student
0..*1 0..*1
RegistrationController
1 11 1
0..1
0..1
0..1
0..1
0..*1
Schedule
What Is Generalization?
8/12/2019 Um l Presentation
75/93
75
A relationship among classes where one
class shares the structure and/or behaviorof one or more classes Defines a hierarchy of abstractions where a
subclass inherits from one or more
superclassesSingle inheritance
Multiple inheritance
Is an is a kind of relationship
Example: Single Inheritance
8/12/2019 Um l Presentation
76/93
76
One class inherits from another.
CheckingSavings
Superclass(parent)
Subclasses
GeneralizationRelationship
Descendents
AncestorAccount
- balance- name- number
+ withdraw()+ createStatement()
Example: Multiple Inheritance
8/12/2019 Um l Presentation
77/93
77
A class can inherit from several other
classes.
Use mult ip le inher itance only w hen needed and
always w ith caut ion!
FlyingThing Animal
HorseWolfBirdHelicopterAirplane
Multiple Inheritance
Review: An Object Has State
8/12/2019 Um l Presentation
78/93
78
The state of an object is one of the possibleconditions in which an object may exist.
The state of an object normally changes overtime.
Name: J ClarkEmployee ID: 567138HireDate: 07/25/1991Status: TenuredDiscipline: FinanceMaxLoad: 3
Name: J Clark
Employee ID: 567138Date Hired: July 25, 1991Status: TenuredDiscipline: FinanceMaximum Course Load: 3 classes Professor Clark
What Are Statechart Diagrams?
8/12/2019 Um l Presentation
79/93
79
A statechart diagram shows a state
machine. It specifies the sequence of states that an
object can be in, the events and conditions that cause the object
to reach those states, and the actions that take place when those states
are reached.
SampleState 1
SampleState 2
Drawing States
8/12/2019 Um l Presentation
80/93
80
A state is represented as a rounded
rectangle on a statechart diagram.As a comparison, note the subtle difference
between a state versus an activity.
SampleState 1
SampleActivity
Special States
8/12/2019 Um l Presentation
81/93
81
The initial state is the state entered when an
object is created.An initial state is mandatory. Only one initial state is permitted.
The initial state is represented as a solid circle.
A final state indicates the end of life for an object.A final state is optional.
More than one final state may exist.
A final state is indicated by a bulls eye.
SampleState 1
SampleState 2
What Are Events?
8/12/2019 Um l Presentation
82/93
82
An event is the specification of a significant
occurrence that has a location in time andspace.An event is an occurrence of a stimulus that can
trigger a state transition.
ExampleAdding a student to a course
Creating a new course
State BState AEvent
What Are Transitions?
8/12/2019 Um l Presentation
83/93
83
A transition is a change from an originating state
to a successor state as a result of some stimulus. The successor state could possibly be the originatingstate.
A transition may take place in response to anevent.
Transitions can be labeled with events.
State BState AEvent
Transition
Example: Statechart
8/12/2019 Um l Presentation
84/93
84
Enrolled
Freshman
Sophmore
Junior
Senior
H
First year
Second year
Third year
Fourth year
Graduated
[ credits >= 112 ]
Applied
[ rejected ]
[ accepted ]
H
[ credits >= 28 ]
[ credits >= 56 ]
[ credits >= 84 ]
Hiatus
return
leave
What Is a Component Diagram?
8/12/2019 Um l Presentation
85/93
85
A diagram that shows the organizations and
dependencies among components.
What Is a Component?
8/12/2019 Um l Presentation
86/93
86
A modular, deployable, and replaceable
part of a system that encapsulatesimplementation and exposes a set ofinterfaces.
It conforms to and provides the physical
realization of a set of interfaces.
Example: Component Diagram
8/12/2019 Um l Presentation
87/93
87
Component A
Component B
Interface
What Is a Deployment Diagram?
8/12/2019 Um l Presentation
88/93
88
The deployment diagram shows the
Configuration of processing nodes at run-time.Communication links between these nodes.
Component instances and objects that resideon them.
What Is a Node?
8/12/2019 Um l Presentation
89/93
89
Physical run-time computational resource
TypesProcessor Node
Executes system software
Device Node Support device
Typically controlled by a processor
Node #1
What Is a Connector?
8/12/2019 Um l Presentation
90/93
90
Connection
Communication mechanismPhysical medium
Software protocol
Processor #1
Devic e #1
Connection
Example: Deployment Diagram
8/12/2019 Um l Presentation
91/93
91
Desktop PCDesktop PC
Registration
Server
CourseCatalog
BillingSystem
8/12/2019 Um l Presentation
92/93
92
Questions
8/12/2019 Um l Presentation
93/93
Thank you