SlideShare a Scribd company logo
© 2005 by Prentice Hall
1
By
Deborah Natumanya
deborahnatumanya@must.ac.ug
0700649348
© 2005 by Prentice Hall
2
By the end of this class we shall have covered
 Define modeling
 Why model
 UML and why UML
▪ Object Diagram
▪ Class Diagram
▪ Activity Diagram
▪ Use case Diagram
▪ Sequence Diagram
▪ Collaboration diagram
© 2005 by Prentice Hall
3
 A model provides the blueprints of a system.
 Models may encompass detailed plans, as
well as more general plans.
 A good model includes those elements that
have broad effect and omits those minor
elements that are not relevant to the given
level of abstraction.
© 2005 by Prentice Hall
4
 We build models so that we can better understand the
system we are developing.
1. Models help us to visualize a system as it is or as we
want it to be.
2. Models permit us to specify the structure or behavior
of a system.
3. Models give us a template that guides us in
constructing a system.
4. Models document the decisions we have made.
© 2005 by Prentice Hall
5
 The Unified Modeling Language (UML) is a standard
language for writing software blueprints.
 The UML may be used to visualize, specify,
construct, and document the artifacts of a software
intensive system.
 The UML is appropriate for modeling systems
ranging from enterprise information systems to
distributed Web-based applications and even to
hard real time embedded systems.
© 2005 by Prentice Hall
6
 For many programmers, the distance
between thinking of an implementation and
then pounding it out in code is close to zero.
 You think it, you code it. In fact, some things
are best cast directly in code.
 First, communicating those conceptual
models to others is error-prone unless
everyone involved speaks the same language.
© 2005 by Prentice Hall
7
 Typically, projects and organizations develop
their own language, and it is difficult to
understand what's going on if you are an
outsider or new to the group.
 Second, there are some things about a
software system you can't understand unless
you build models that transcend the textual
programming language.
 The UML is such a graphical language.
© 2005 by Prentice Hall
8
 In this context, specifying means building
models that are precise, unambiguous, and
complete.
 In particular, the UML addresses the
specification of all the important analysis,
design and implementation decisions that
must be made in developing and deploying a
software-intensive system.
© 2005 by Prentice Hall
9
 The UML is not a visual programming language, but
its models can be directly connected to a variety of
programming languages.
 This means that it is possible to map from a model
in the UML to a programming language such as
Java, C++, or Visual Basic, or even to tables in a
relational database or the persistent store of an
object-oriented database.
 Things that are best expressed graphically are done
so graphically in the UML, whereas things that are
best expressed textually are done so in the
programming language.
© 2005 by Prentice Hall
10
 A healthy software organization produces all sorts of
artifacts in addition to raw executable code.
 These artifacts include (but are not limited to) Requirements,
Architecture, Design, Source code, Project plans, Tests,
Prototypes, and Releases
 The UML addresses the documentation of a system's
architecture and all of its details. The UML also provides a
language for expressing requirements and for tests.
 Finally, the UML provides a language for modeling the
activities of project planning and release management.
© 2005 by Prentice Hall
11
 Each UML diagram is designed to let developers and
customers view a software system from a different
perspective and in varying degrees of abstraction. UML
diagrams commonly created in visual modeling tools
include:
▪ Object diagram
▪ Class diagram
▪ Activity diagram
▪ Use case diagram
▪ Sequence diagram
▪ Collaboration diagram
© 2005 by Prentice Hall
12
 An object diagram shows a set of objects and their
relationships. You use object diagrams to illustrate
data structures, the static snapshots of instances of
the things found in class diagrams.
 Object diagrams address the static design view or
static process view of a system just as do class
diagrams, but from the perspective of real or
prototypical cases.
© 2005 by Prentice Hall
13
student course
person
major
address
<< has address
married-to
major subject
>>
enrolled in >>
0+
0-1
1+
© 2005 by Prentice Hall
14
man woman
0-1 0-1
w ife
husband
marriage
date: Date
city
registered in >>
© 2005 by Prentice Hall
15
 A class diagram shows a set of classes, interfaces, and
collaborations and their relationships.
 Class diagrams are the most common diagram found in
modeling object-oriented systems.
 We can use class diagrams to illustrate the static design view
of a system.
 Class diagrams that include active classes are used to
address the static process view of a system.
 Class Diagram models show class structure and contents
using design elements such as classes, packages and objects.
It also displays relationships such as containment,
inheritance, associations and others.
© 2005 by Prentice Hall
16
• A class diagram is a view of the static structure of a
system
– Models contain many class diagrams
• Class diagrams contain:
– Packages, classes, interfaces, and relationships
• Notation:
Interface Name
<<Interface>>
Class Name
Package
Name
© 2005 by Prentice Hall
17
• Class diagrams may contain the following
relationships:
– Association, aggregation, dependency, realize,
and inheritance
• Notation:
© 2005 by Prentice Hall
18
• Each end of an association or aggregation
contains a multiplicity indicator
– Indicates the number of objects participating in
the relationship
Zero or more
0..*
One or more
1..*
Zero or one
0..1
Specified range
2..7
Exactly one
1
© 2005 by Prentice Hall
19
© 2005 by Prentice Hall
20
class name
attribute-1: value-set
attribute-2: value-set
operation-1(Par1:Type, Par2:Type): ReturnType
library book
catalog#: string
title: string
author: string
category: Category
cover-type: {hard-cover, paperback}
available(): Boolean
libr
bo
© 2005 by Prentice Hall
21
© 2005 by Prentice Hall
22
More on class and object diagrams
© 2005 by Prentice Hall
23
 Use Case Diagram displays the relationship among
actors and use cases.
 A use case diagram shows a set of use cases and
actors (a special kind of class) and their
relationships.
 You apply use case diagrams to illustrate the static
use case view of a system.
 Use case diagrams are especially important in
organizing and modeling the behaviors of a
system.
© 2005 by Prentice Hall
24
 A use case encodes a typical user interaction with the
system. In particular, it:
 captures some user-visible function.
 achieves some concrete goal for the user.
 A complete set of use cases largely defines the requirements
for your system: everything the user can see, and would like
to do.
 The granularity of your use cases determines the number of
them (for your system). A clear design depends on showing
the right level of detail.
 A use case maps actors to functions. The actors need not be
people.
© 2005 by Prentice Hall
25
library system
lend book
make book
reservation
search library
catalog
add book
to catalog
remove book
from catalog
lender librarian
Primary actor(initiate the system) on right and secondary actor on left(reactionary)
© 2005 by Prentice Hall
26
student
tutor
update
student data
inspect
course info
update
course info
enroll
in course
enter
exam results
browse
enrollments
browse
exam results
browse
individual
results
browse
course
results
administrative
staff
© 2005 by Prentice Hall
27
Use case diagram Cont....
The notes between << >> marks are stereotypes: identifiers added to
make the diagram more informative.
© 2005 by Prentice Hall
28
 An activity diagram shows the flow from activity to activity within a
system.
 An activity shows a set of activities, the sequential or branching flow
from activity to activity, and objects that act and are acted upon.
 You use activity diagrams to illustrate the dynamic view of a system.
 Activity diagrams are especially important in modeling the function of a
system.
 Activity diagrams emphasize the flow of control among objects.
 Activity Diagram displays a special state diagram where most of the
states are action states and most of the transitions are triggered by
completion of the actions in the source states.
 This diagram focuses on flows driven by internal processing.
© 2005 by Prentice Hall
29
dataentry
processing
generate
output
write
tender
get customer
information
SALES
DEPARTMENT
calculate
cost
DESIGN
DEPARTMENT
design
elevator
© 2005 by Prentice Hall
30
Cont…
© 2005 by Prentice Hall
31
© 2005 by Prentice Hall
32
© 2005 by Prentice Hall
33
 Interaction Diagrams : Sequence and Collaboration
diagrams
 Sequence Diagram displays the time sequence of the objects
participating in the interaction. This consists of the vertical
dimension (time) and horizontal dimension (different objects).
 A sequence diagram is an interaction diagram that
emphasizes the time ordering of messages.
 A sequence diagram shows a set of objects and the
messages sent and received by those objects.
 The objects are typically named or anonymous instances of
classes, but may also represent instances of other things,
such as collaborations, components, and nodes.
 You use sequence diagrams to illustrate the dynamic view of
a system.
© 2005 by Prentice Hall
34
© 2005 by Prentice Hall
35
© 2005 by Prentice Hall
36
• Collaboration Diagram displays an interaction organized
around the objects and their links to one another. Numbers
are used to show the sequence of messages.
 A collaboration diagram is an interaction diagram that
emphasizes the structural organization of the objects that
send and receive messages.
 A collaboration diagram shows a set of objects, links among
those objects, and messages sent and received by those
objects.
 The objects are typically named or anonymous instances of
classes, but may also represent instances of other things,
such as collaborations, components, and nodes.
 You use collaboration diagrams to illustrate the dynamic view of a system.
© 2005 by Prentice Hall
37
© 2005 by Prentice Hall
38
Other UML diagrams include :
 State diagrams: similar in function to sequence diagrams,
but with focus on the prerequisites for an operation, rather
than the exact sequence of actions.
 Deployment diagrams: shows the installation of software on
hardware platforms.
 Package diagram: A type of class diagram, package
diagrams show dependencies between high-level system
component
© 2005 by Prentice Hall
39
I. Rational rose
II. MicrosoftVisio paradigm
© 2005 by Prentice Hall
40
Discuss the following UML diagrams:
1. Activity
2. Sequence
3. Collaboration
4. State Machine
5. Component
6. Deployment
7. Package
© 2005 by Prentice Hall
41
Good Luck

More Related Content

PDF
Design UML diagrams
PDF
Design UML diagrams
PPT
4.o o design tools=uml -_lecture 4
PPT
Uml(unified modeling language) Homework Help
PDF
Object-Oriented Analysis and Design report
PPT
UML (Hemant rajak)
PPT
Uml Explained Step ByStep
PPTX
Architecture and design
Design UML diagrams
Design UML diagrams
4.o o design tools=uml -_lecture 4
Uml(unified modeling language) Homework Help
Object-Oriented Analysis and Design report
UML (Hemant rajak)
Uml Explained Step ByStep
Architecture and design

Similar to lecture8UML Diagrams.pptx (20)

PDF
Modeling software with UML
PDF
Case stydy cs701
DOC
Ooad lab manual
PPTX
UML Diagrams.pptxUML DiagramsUML DiagramsUML Diagrams
DOC
Uml overview modified
PDF
Software Engineering Tools and Practices.pdf
PPT
Apostila UML
DOC
Case Study Uml
PPTX
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
PPT
analysis and design with uml
PPT
Uml tool tutorial
PPT
Chapter1
PPTX
PDF
l1_introuml.pdf
PPT
PPTX
Uml diagram assignment help
PPTX
Understanding unified modelling language
PPT
Introduction To Uml
PDF
Design and Implementation in Software Engineering
Modeling software with UML
Case stydy cs701
Ooad lab manual
UML Diagrams.pptxUML DiagramsUML DiagramsUML Diagrams
Uml overview modified
Software Engineering Tools and Practices.pdf
Apostila UML
Case Study Uml
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
analysis and design with uml
Uml tool tutorial
Chapter1
l1_introuml.pdf
Uml diagram assignment help
Understanding unified modelling language
Introduction To Uml
Design and Implementation in Software Engineering

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Big Data Technologies - Introduction.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
sap open course for s4hana steps from ECC to s4
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Big Data Technologies - Introduction.pptx
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Chapter 3 Spatial Domain Image Processing.pdf
sap open course for s4hana steps from ECC to s4

lecture8UML Diagrams.pptx

  • 1. © 2005 by Prentice Hall 1 By Deborah Natumanya deborahnatumanya@must.ac.ug 0700649348
  • 2. © 2005 by Prentice Hall 2 By the end of this class we shall have covered  Define modeling  Why model  UML and why UML ▪ Object Diagram ▪ Class Diagram ▪ Activity Diagram ▪ Use case Diagram ▪ Sequence Diagram ▪ Collaboration diagram
  • 3. © 2005 by Prentice Hall 3  A model provides the blueprints of a system.  Models may encompass detailed plans, as well as more general plans.  A good model includes those elements that have broad effect and omits those minor elements that are not relevant to the given level of abstraction.
  • 4. © 2005 by Prentice Hall 4  We build models so that we can better understand the system we are developing. 1. Models help us to visualize a system as it is or as we want it to be. 2. Models permit us to specify the structure or behavior of a system. 3. Models give us a template that guides us in constructing a system. 4. Models document the decisions we have made.
  • 5. © 2005 by Prentice Hall 5  The Unified Modeling Language (UML) is a standard language for writing software blueprints.  The UML may be used to visualize, specify, construct, and document the artifacts of a software intensive system.  The UML is appropriate for modeling systems ranging from enterprise information systems to distributed Web-based applications and even to hard real time embedded systems.
  • 6. © 2005 by Prentice Hall 6  For many programmers, the distance between thinking of an implementation and then pounding it out in code is close to zero.  You think it, you code it. In fact, some things are best cast directly in code.  First, communicating those conceptual models to others is error-prone unless everyone involved speaks the same language.
  • 7. © 2005 by Prentice Hall 7  Typically, projects and organizations develop their own language, and it is difficult to understand what's going on if you are an outsider or new to the group.  Second, there are some things about a software system you can't understand unless you build models that transcend the textual programming language.  The UML is such a graphical language.
  • 8. © 2005 by Prentice Hall 8  In this context, specifying means building models that are precise, unambiguous, and complete.  In particular, the UML addresses the specification of all the important analysis, design and implementation decisions that must be made in developing and deploying a software-intensive system.
  • 9. © 2005 by Prentice Hall 9  The UML is not a visual programming language, but its models can be directly connected to a variety of programming languages.  This means that it is possible to map from a model in the UML to a programming language such as Java, C++, or Visual Basic, or even to tables in a relational database or the persistent store of an object-oriented database.  Things that are best expressed graphically are done so graphically in the UML, whereas things that are best expressed textually are done so in the programming language.
  • 10. © 2005 by Prentice Hall 10  A healthy software organization produces all sorts of artifacts in addition to raw executable code.  These artifacts include (but are not limited to) Requirements, Architecture, Design, Source code, Project plans, Tests, Prototypes, and Releases  The UML addresses the documentation of a system's architecture and all of its details. The UML also provides a language for expressing requirements and for tests.  Finally, the UML provides a language for modeling the activities of project planning and release management.
  • 11. © 2005 by Prentice Hall 11  Each UML diagram is designed to let developers and customers view a software system from a different perspective and in varying degrees of abstraction. UML diagrams commonly created in visual modeling tools include: ▪ Object diagram ▪ Class diagram ▪ Activity diagram ▪ Use case diagram ▪ Sequence diagram ▪ Collaboration diagram
  • 12. © 2005 by Prentice Hall 12  An object diagram shows a set of objects and their relationships. You use object diagrams to illustrate data structures, the static snapshots of instances of the things found in class diagrams.  Object diagrams address the static design view or static process view of a system just as do class diagrams, but from the perspective of real or prototypical cases.
  • 13. © 2005 by Prentice Hall 13 student course person major address << has address married-to major subject >> enrolled in >> 0+ 0-1 1+
  • 14. © 2005 by Prentice Hall 14 man woman 0-1 0-1 w ife husband marriage date: Date city registered in >>
  • 15. © 2005 by Prentice Hall 15  A class diagram shows a set of classes, interfaces, and collaborations and their relationships.  Class diagrams are the most common diagram found in modeling object-oriented systems.  We can use class diagrams to illustrate the static design view of a system.  Class diagrams that include active classes are used to address the static process view of a system.  Class Diagram models show class structure and contents using design elements such as classes, packages and objects. It also displays relationships such as containment, inheritance, associations and others.
  • 16. © 2005 by Prentice Hall 16 • A class diagram is a view of the static structure of a system – Models contain many class diagrams • Class diagrams contain: – Packages, classes, interfaces, and relationships • Notation: Interface Name <<Interface>> Class Name Package Name
  • 17. © 2005 by Prentice Hall 17 • Class diagrams may contain the following relationships: – Association, aggregation, dependency, realize, and inheritance • Notation:
  • 18. © 2005 by Prentice Hall 18 • Each end of an association or aggregation contains a multiplicity indicator – Indicates the number of objects participating in the relationship Zero or more 0..* One or more 1..* Zero or one 0..1 Specified range 2..7 Exactly one 1
  • 19. © 2005 by Prentice Hall 19
  • 20. © 2005 by Prentice Hall 20 class name attribute-1: value-set attribute-2: value-set operation-1(Par1:Type, Par2:Type): ReturnType library book catalog#: string title: string author: string category: Category cover-type: {hard-cover, paperback} available(): Boolean libr bo
  • 21. © 2005 by Prentice Hall 21
  • 22. © 2005 by Prentice Hall 22 More on class and object diagrams
  • 23. © 2005 by Prentice Hall 23  Use Case Diagram displays the relationship among actors and use cases.  A use case diagram shows a set of use cases and actors (a special kind of class) and their relationships.  You apply use case diagrams to illustrate the static use case view of a system.  Use case diagrams are especially important in organizing and modeling the behaviors of a system.
  • 24. © 2005 by Prentice Hall 24  A use case encodes a typical user interaction with the system. In particular, it:  captures some user-visible function.  achieves some concrete goal for the user.  A complete set of use cases largely defines the requirements for your system: everything the user can see, and would like to do.  The granularity of your use cases determines the number of them (for your system). A clear design depends on showing the right level of detail.  A use case maps actors to functions. The actors need not be people.
  • 25. © 2005 by Prentice Hall 25 library system lend book make book reservation search library catalog add book to catalog remove book from catalog lender librarian Primary actor(initiate the system) on right and secondary actor on left(reactionary)
  • 26. © 2005 by Prentice Hall 26 student tutor update student data inspect course info update course info enroll in course enter exam results browse enrollments browse exam results browse individual results browse course results administrative staff
  • 27. © 2005 by Prentice Hall 27 Use case diagram Cont.... The notes between << >> marks are stereotypes: identifiers added to make the diagram more informative.
  • 28. © 2005 by Prentice Hall 28  An activity diagram shows the flow from activity to activity within a system.  An activity shows a set of activities, the sequential or branching flow from activity to activity, and objects that act and are acted upon.  You use activity diagrams to illustrate the dynamic view of a system.  Activity diagrams are especially important in modeling the function of a system.  Activity diagrams emphasize the flow of control among objects.  Activity Diagram displays a special state diagram where most of the states are action states and most of the transitions are triggered by completion of the actions in the source states.  This diagram focuses on flows driven by internal processing.
  • 29. © 2005 by Prentice Hall 29 dataentry processing generate output write tender get customer information SALES DEPARTMENT calculate cost DESIGN DEPARTMENT design elevator
  • 30. © 2005 by Prentice Hall 30 Cont…
  • 31. © 2005 by Prentice Hall 31
  • 32. © 2005 by Prentice Hall 32
  • 33. © 2005 by Prentice Hall 33  Interaction Diagrams : Sequence and Collaboration diagrams  Sequence Diagram displays the time sequence of the objects participating in the interaction. This consists of the vertical dimension (time) and horizontal dimension (different objects).  A sequence diagram is an interaction diagram that emphasizes the time ordering of messages.  A sequence diagram shows a set of objects and the messages sent and received by those objects.  The objects are typically named or anonymous instances of classes, but may also represent instances of other things, such as collaborations, components, and nodes.  You use sequence diagrams to illustrate the dynamic view of a system.
  • 34. © 2005 by Prentice Hall 34
  • 35. © 2005 by Prentice Hall 35
  • 36. © 2005 by Prentice Hall 36 • Collaboration Diagram displays an interaction organized around the objects and their links to one another. Numbers are used to show the sequence of messages.  A collaboration diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages.  A collaboration diagram shows a set of objects, links among those objects, and messages sent and received by those objects.  The objects are typically named or anonymous instances of classes, but may also represent instances of other things, such as collaborations, components, and nodes.  You use collaboration diagrams to illustrate the dynamic view of a system.
  • 37. © 2005 by Prentice Hall 37
  • 38. © 2005 by Prentice Hall 38 Other UML diagrams include :  State diagrams: similar in function to sequence diagrams, but with focus on the prerequisites for an operation, rather than the exact sequence of actions.  Deployment diagrams: shows the installation of software on hardware platforms.  Package diagram: A type of class diagram, package diagrams show dependencies between high-level system component
  • 39. © 2005 by Prentice Hall 39 I. Rational rose II. MicrosoftVisio paradigm
  • 40. © 2005 by Prentice Hall 40 Discuss the following UML diagrams: 1. Activity 2. Sequence 3. Collaboration 4. State Machine 5. Component 6. Deployment 7. Package
  • 41. © 2005 by Prentice Hall 41 Good Luck