SlideShare une entreprise Scribd logo
1  sur  49
Chapter 3
UML
Presented by:
Dr.Fahad Alsheref
Outlines
• Unified Modeling Language
• Structure Diagrams
• Modeling Behavior
UML Diagrams
• UML recognizes 13 diagram types, although
most users of UML make do using three or four
types of diagram, depending on what they are
using it for.
UML Diagrams
• UML recognizes 13 diagram types, although
most users of UML make do using three or four
types of diagram, depending on what they are
using it for.
UML class diagrams
5
 UML class diagram: a picture of the classes in an OO
system, their fields and methods, and connections
between the classes that interact or inherit from each
other details of how the classes interact with each other
algorithmic details; how a particular behavior is
implemented.
Diagram of one class
• class name in top of box
– write <<interface>> on top of interfaces' names
– use italics for an abstract class name
• attributes (optional)
– should include all fields of the object
• operations / methods (optional)
– may omit trivial (get/set) methods
• but don't omit any methods from an interface!
– should not include inherited methods
6
Class attributes
• attributes (fields, instance variables)
– visibility name : type [count] = default_value
– visibility: + public
# protected
- private
~ package (default)
/ derived
– underline static attributes
– derived attribute: not stored, but can
be computed from other attribute values
– attribute example:
- balance : double = 0.00
7
Class operations / methods
• operations / methods
– visibility name (parameters) : return_type
– visibility: + public
# protected
- private
~ package (default)
– underline static methods
– parameter types listed as (name: type)
– omit return_type on constructors and
when return type is void
– method example:
+ distance(p1: Point, p2: Point): double
8
Comments
• represented as a folded note, attached to the
appropriate class/method/etc by a dashed line
9
Relationships btwn. classes
• generalization: an inheritance relationship
– inheritance between classes
– interface implementation
• association: a usage relationship
– dependency
– aggregation
– composition
10
Generalization relationships
• Generalization (Inheritance) Relationships
– Hierarchies Drawn Top-down With Arrows
Pointing Upward To Parent
– Line/Arrow Styles Differ, Based On Whether
Parent Is A(n):
• Class:
Solid Line, Black Arrow
• Abstract Class:
Solid Line, White Arrow
• Interface:
Dashed Line, White Arrow
– We Often Don't Draw Trivial / Obvious
Generalization Relationships, Such As Drawing
The Object Class As A Parent
11
Associational relationships
• Associational (Usage) Relationships
1. Multiplicity (How Many Are Used)
• *  0, 1, Or More
• 1  1 Exactly
• 2..4  Between 2 And 4, Inclusive
• 3..*  3 Or More
2. Name (What Relationship The Objects Have)
3. Navigability (Direction)
12
Multiplicity of associations
13
 one-to-one
 each student must carry exactly one ID card
 one-to-many
 one rectangle list can contain many rectangles
Class diagram example 1
14
Class diagram example 2
15
DVD Movie VHS Movie Video Game
Rental Item
Rental Invoice
1..*
1
Customer
Checkout Screen
0..1
1
Simple
Association
Class
Abstract
Class
Simple
Aggregation
Generalization
Composition
Multiplicity
Class diagram example 3
16
StudentBody
+ main (args : String[])
+ toString() : String
1 100
Student
- firstName : String
- lastName : String
- homeAddress : Address
- schoolAddress : Address
+ toString() : String
- streetAddress : String
- city : String
- state : String
- zipCode : long
Address
Class design exercise
• Consider this Texas Hold 'em poker game system:
– 2 to 8 human or computer players
– Each player has a name and stack of chips
– Computer players have a difficulty setting: easy, medium,
hard
– Summary of each hand:
• Dealer collects ante from appropriate players, shuffles
the deck, and deals each player a hand of 2 cards from
the deck.
• A betting round occurs, followed by dealing 3 shared
cards from the deck.
• As shared cards are dealt, more betting rounds occur,
where each player can fold, check, or raise.
• At the end of a round, if more than one player is
remaining, players' hands are compared, and the best
hand wins the pot of all chips bet so far. 17
Class design exercise
– Draw a class diagram for this system. Include
relationships between classes (generalization and
associational).
18
UML Modeling Behavior
19
 Use Case: a picture of the classes in an OO system, their
fields and methods, and connections between the
classes that interact or inherit from each other details of
how the classes interact with each other algorithmic
details; how a particular behavior is implemented.
Use Cases
• The use case is a summary of scenarios for a
single task or goal.
• So What is the Use Case????
• The Use Case is Make Appointment.
• It is a use case for the medical clinic.
Use Cases
• The picture below is a Make Appointment use case for
the medical clinic.
• The actor is a Patient. The connection between actor and
use case is a communication association (or
communication for short).
Actors are stick figures. Use cases are ovals. Communications are lines that
link actors to use cases.
Use Case Components
• The use case has three components.
• The use case task referred to as the use case that
represents a feature needed in a software system.
• The actor(s) who trigger the use case to activate.
• The communication line to show how the actors
communicate with the use case.
Use Case Diagram - Use Case
• A major process performed by the system that
benefits an actor(s) in some way
• Models a dialogue between an actor and the system
• Represents the functionality provided by the system
Use Case
• Each use case in a use case diagram describes one
and only one function in which users interact with
the system
– May contain several “paths” that a user can take
while interacting with the system
– Each path is referred to as a scenario
Use Case
• Labelled using a descriptive verb-noun phrase
• Represented by an oval
Make
Appointment
Make
Appointment
Use Case - Actor
• Labelled using a descriptive noun or phrase
• Represented by a stick character
Use Case - Relationships
• Relationships
– Represent communication between actor and use
case
– Depicted by line or double-headed arrow line
– Also called association relationship
Make
Appointment
Use Case - Relationships
• Boundary
– A boundary rectangle is placed around the perimeter
of the system to show how the actors communicate
with the system.
Make
Appointment
Guidelines for Creating
Use-Case Diagrams
– Order messages from left to right, top to bottom
• Name actors and objects the same if they represent the
same idea
• Place the initiator of the scenario on the left of the
diagram
• Multiple objects of the same class: name each
• Only show return values when they are not obvious
• Justify messages near the arrowhead for improved
readability
Use-Case Diagram
A use case diagram is a collection of actors, use cases, and their communications.
Example of Relationships
State Machine
Software Design (UML)
• An object must be in some specific state at any given time
during its lifecycle.
• An object transitions from one state to another as the
result of some event that affects it.
• You may create a state diagram for any class,
collaboration, operation, or use case in a UML model .
• There can be only one start state in a state diagram, but
there may be many intermediate and final states.
State Machine Syntax
Components of State Machines
• States—values of an object’s attributes at a point in
time
• Events—the cause of the change in values of the
object’s attributes
• Transitions—movement of an object from one state
to another
– May include a guard condition to flag that a condition is true and
allow the transition
Sample State Machine
State Machine
Software Design (UML)
selecting
verifying
downloading
checking schedule
download course offerings
make a course selection
verify selection
check schedule
select another course
make a different selection
unscheduled
scheduled
sign schedule
Guidelines for Creating Behavioral State
Machines
• Use only for complex objects
• Draw the initial state in the upper left corner
• Draw the final state in the bottom right corner
• Use simple, but descriptive names for states
• Look out for “black holes” and “miracles”
• Ensure guard conditions are mutually exclusive
• Ensure transitions are associated with messages
and operations
Building a Behavioral State Machine
• Set the context
• Identify the states of the object
• Initial
• Final
• Stable states during its lifetime
• Lay out the diagram—use a left to right sequence
• Add the transitions
• Identify the triggers (events that cause the transition)
• Identify the actions which execute
• Identify the guard conditions
• Validate the model—ensure all states are reachable
UML Modeling Behavior
39
 Sequence Diagram: Sequence Diagram is a diagram that
depicts object interactions arranged in time sequence,
where the direction of time is down the page. The
objects, which exchange information, are shown at the
top of a vertical line or bar, known as the object’s
lifeline. An arrow between the lifelines of two objects
represents each message.
Sequence Diagram Syntax
More Sequence Diagram Syntax
Sequence Diagram
Software Design (UML)
An object in a sequence diagram is rendered
as a box with a dashed line descending from it.
The line is called the object lifeline, and it
represents the existence of an object over a
period of time.
an Order Line
Sequence Diagram
Software Design (UML)
an Order Line a Stock Item
[check = “true”]
remove()
check()
Messages are rendered as horizontal
arrows being passed from object to
object as time advances down the
object lifelines. Conditions ( such as
[check = “true”] ) indicate when a
message gets passed.
Sequence Diagram
Software Design (UML)
an Order Line a Stock Item
[check = “true”]
remove()
check()
Notice that the bottom arrow is different. The arrow
head is not solid, and there is no accompanying
message.
This arrow indicates a return from a previous
message, not a new message.
Sequence Diagram
Software Design (UML)
an Order a Order Line
* prepare()
An iteration marker, such as * (as shown), or *[i
= 1..n] , indicates that a message will be
repeated as indicated.
Iteration
marker
Sample Sequence Diagram
Building Sequence Diagrams
• Set the context
• Identify actors and objects that interact in the use-case
scenario
• Set the lifeline for each object
• Add messages by drawing arrows
• Shows how they are passed from one object to
another
• Include any parameters in parentheses
• Obvious return values are excluded
• Add execution occurrence to each object’s lifeline
• Validate the sequence diagram
• Ensures that it depicts all of the steps in the process
Thank for your listening

Contenu connexe

Tendances

Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Umlguest514814
 
UML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionUML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionRamakant Soni
 
What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?Eliza Wright
 
Uml difference faqs- 1
Uml difference  faqs- 1Uml difference  faqs- 1
Uml difference faqs- 1Umar Ali
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationanasz3z3
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagramsbarney92
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagramsAjit Nayak
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGERaval Chirag
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbolsKumar
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSAshita Agrawal
 

Tendances (20)

Introduction To Uml
Introduction To UmlIntroduction To Uml
Introduction To Uml
 
UML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language IntroductionUML Diagrams- Unified Modeling Language Introduction
UML Diagrams- Unified Modeling Language Introduction
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
UML - An Introduction
UML - An IntroductionUML - An Introduction
UML - An Introduction
 
What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?What is UML (Unified Modeling Language)?
What is UML (Unified Modeling Language)?
 
Uml difference faqs- 1
Uml difference  faqs- 1Uml difference  faqs- 1
Uml difference faqs- 1
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
UML Basics
UML BasicsUML Basics
UML Basics
 
UML
UMLUML
UML
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Software Engineering :UML class diagrams
Software Engineering :UML class diagramsSoftware Engineering :UML class diagrams
Software Engineering :UML class diagrams
 
Behavioural modelling
Behavioural modellingBehavioural modelling
Behavioural modelling
 
UNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGEUNIFIED MODELING LANGUAGE
UNIFIED MODELING LANGUAGE
 
UML diagrams and symbols
UML diagrams and symbolsUML diagrams and symbols
UML diagrams and symbols
 
Uml Diagrams
Uml DiagramsUml Diagrams
Uml Diagrams
 
CS8592-OOAD Lecture Notes Unit-2
CS8592-OOAD Lecture Notes Unit-2CS8592-OOAD Lecture Notes Unit-2
CS8592-OOAD Lecture Notes Unit-2
 
UML
UMLUML
UML
 
INTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMSINTRODUCTION TO UML DIAGRAMS
INTRODUCTION TO UML DIAGRAMS
 

Similaire à Chapter3

Lecture#03, uml diagrams
Lecture#03, uml diagramsLecture#03, uml diagrams
Lecture#03, uml diagramsbabak danyal
 
Basic Behavioral Modeling
Basic Behavioral ModelingBasic Behavioral Modeling
Basic Behavioral ModelingAMITJain879
 
CASE Tools lab.ppt
CASE Tools lab.pptCASE Tools lab.ppt
CASE Tools lab.pptRAJESH S
 
1. introduction to uml
1. introduction to uml1. introduction to uml
1. introduction to umlPRABU M
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
 
UNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxUNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxviju001
 
UML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxUML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxraghavanp4
 
Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)stanbridge
 
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejeUML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejessusera6a60c1
 
Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction DiagramNiloy Rocker
 
lecture 3.ppt
lecture  3.pptlecture  3.ppt
lecture 3.pptTik Tok
 

Similaire à Chapter3 (20)

Lecture#03, uml diagrams
Lecture#03, uml diagramsLecture#03, uml diagrams
Lecture#03, uml diagrams
 
Basic Behavioral Modeling
Basic Behavioral ModelingBasic Behavioral Modeling
Basic Behavioral Modeling
 
CASE Tools lab.ppt
CASE Tools lab.pptCASE Tools lab.ppt
CASE Tools lab.ppt
 
1. introduction to uml
1. introduction to uml1. introduction to uml
1. introduction to uml
 
UML
UMLUML
UML
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 
UML tutorial
UML tutorialUML tutorial
UML tutorial
 
UNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptxUNIT-3 Design Using UML (1).pptx
UNIT-3 Design Using UML (1).pptx
 
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
 
UML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxUML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptx
 
uml.ppt
uml.pptuml.ppt
uml.ppt
 
Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)
 
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejnejeUML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
UML_Lecture.pptxnd bfdjjrnekdddkeeeenekejneje
 
Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction Diagram
 
CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3CS8592-OOAD Lecture Notes Unit-3
CS8592-OOAD Lecture Notes Unit-3
 
lecture 3.ppt
lecture  3.pptlecture  3.ppt
lecture 3.ppt
 
Uml
UmlUml
Uml
 
Uml lecture
Uml lectureUml lecture
Uml lecture
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Case Study Uml
Case Study UmlCase Study Uml
Case Study Uml
 

Dernier

Single Assessment Framework - What We Know So Far
Single Assessment Framework - What We Know So FarSingle Assessment Framework - What We Know So Far
Single Assessment Framework - What We Know So FarCareLineLive
 
Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...
Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...
Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...Oleg Kshivets
 
Preventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdf
Preventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdfPreventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdf
Preventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdfAditiAlishetty
 
The future of change - strategic translation
The future of change - strategic translationThe future of change - strategic translation
The future of change - strategic translationHelenBevan4
 
Medisep insurance policy , new kerala government insurance policy for govrnm...
Medisep insurance policy , new  kerala government insurance policy for govrnm...Medisep insurance policy , new  kerala government insurance policy for govrnm...
Medisep insurance policy , new kerala government insurance policy for govrnm...LinshaLichu1
 
ANTIGEN- SECTION IMMUNOLOGY DEPARTMENT OF MICROBIOLOGY
ANTIGEN- SECTION IMMUNOLOGY  DEPARTMENT OF MICROBIOLOGYANTIGEN- SECTION IMMUNOLOGY  DEPARTMENT OF MICROBIOLOGY
ANTIGEN- SECTION IMMUNOLOGY DEPARTMENT OF MICROBIOLOGYDrmayuribhise
 
lupus quiz.pptx for knowing lupus thoroughly
lupus quiz.pptx for knowing lupus thoroughlylupus quiz.pptx for knowing lupus thoroughly
lupus quiz.pptx for knowing lupus thoroughlyRitasman Baisya
 
Information about acne, detail description of their treatment by topical and ...
Information about acne, detail description of their treatment by topical and ...Information about acne, detail description of their treatment by topical and ...
Information about acne, detail description of their treatment by topical and ...mauryashreya478
 
Critical Advancements in Healthcare Software Development | smartData Enterpri...
Critical Advancements in Healthcare Software Development | smartData Enterpri...Critical Advancements in Healthcare Software Development | smartData Enterpri...
Critical Advancements in Healthcare Software Development | smartData Enterpri...amynickle2106
 
TEENAGE PREGNANCY PREVENTION AND AWARENESS
TEENAGE PREGNANCY PREVENTION AND AWARENESSTEENAGE PREGNANCY PREVENTION AND AWARENESS
TEENAGE PREGNANCY PREVENTION AND AWARENESSPeterJamesVitug
 
Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...
Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...
Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...The Lifesciences Magazine
 
Mobile Health And Apps (mhealth) How to design Application for medical App.pptx
Mobile Health And Apps (mhealth) How to design Application for medical App.pptxMobile Health And Apps (mhealth) How to design Application for medical App.pptx
Mobile Health And Apps (mhealth) How to design Application for medical App.pptxMahesh Chopra
 
Globalny raport: „Prawdziwe piękno 2024" od Dove
Globalny raport: „Prawdziwe piękno 2024" od DoveGlobalny raport: „Prawdziwe piękno 2024" od Dove
Globalny raport: „Prawdziwe piękno 2024" od Doveagatadrynko
 
Learn Tips for Managing Chemobrain or Mental Fogginess
Learn Tips for Managing Chemobrain or Mental FogginessLearn Tips for Managing Chemobrain or Mental Fogginess
Learn Tips for Managing Chemobrain or Mental Fogginessbkling
 
Field exchange, Issue 72 April 2024 FEX-72.pdf
Field exchange, Issue 72 April 2024 FEX-72.pdfField exchange, Issue 72 April 2024 FEX-72.pdf
Field exchange, Issue 72 April 2024 FEX-72.pdfMohamed Miyir
 
Clinical Education Presentation at Accelacare
Clinical Education Presentation at AccelacareClinical Education Presentation at Accelacare
Clinical Education Presentation at Accelacarepablor40
 
FAMILY in sociology for physiotherapists.pptx
FAMILY in sociology for physiotherapists.pptxFAMILY in sociology for physiotherapists.pptx
FAMILY in sociology for physiotherapists.pptxMumux Mirani
 

Dernier (20)

Single Assessment Framework - What We Know So Far
Single Assessment Framework - What We Know So FarSingle Assessment Framework - What We Know So Far
Single Assessment Framework - What We Know So Far
 
Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...
Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...
Local Advanced Esophageal Cancer (T3-4N0-2M0): Artificial Intelligence, Syner...
 
Preventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdf
Preventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdfPreventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdf
Preventing Common Nutritional Deficiencies In Poultry Flocks (PPT).pdf
 
DELIRIUM psychiatric delirium is a organic mental disorder
DELIRIUM  psychiatric  delirium is a organic mental disorderDELIRIUM  psychiatric  delirium is a organic mental disorder
DELIRIUM psychiatric delirium is a organic mental disorder
 
The future of change - strategic translation
The future of change - strategic translationThe future of change - strategic translation
The future of change - strategic translation
 
Medisep insurance policy , new kerala government insurance policy for govrnm...
Medisep insurance policy , new  kerala government insurance policy for govrnm...Medisep insurance policy , new  kerala government insurance policy for govrnm...
Medisep insurance policy , new kerala government insurance policy for govrnm...
 
ANTIGEN- SECTION IMMUNOLOGY DEPARTMENT OF MICROBIOLOGY
ANTIGEN- SECTION IMMUNOLOGY  DEPARTMENT OF MICROBIOLOGYANTIGEN- SECTION IMMUNOLOGY  DEPARTMENT OF MICROBIOLOGY
ANTIGEN- SECTION IMMUNOLOGY DEPARTMENT OF MICROBIOLOGY
 
lupus quiz.pptx for knowing lupus thoroughly
lupus quiz.pptx for knowing lupus thoroughlylupus quiz.pptx for knowing lupus thoroughly
lupus quiz.pptx for knowing lupus thoroughly
 
Information about acne, detail description of their treatment by topical and ...
Information about acne, detail description of their treatment by topical and ...Information about acne, detail description of their treatment by topical and ...
Information about acne, detail description of their treatment by topical and ...
 
Critical Advancements in Healthcare Software Development | smartData Enterpri...
Critical Advancements in Healthcare Software Development | smartData Enterpri...Critical Advancements in Healthcare Software Development | smartData Enterpri...
Critical Advancements in Healthcare Software Development | smartData Enterpri...
 
TEENAGE PREGNANCY PREVENTION AND AWARENESS
TEENAGE PREGNANCY PREVENTION AND AWARENESSTEENAGE PREGNANCY PREVENTION AND AWARENESS
TEENAGE PREGNANCY PREVENTION AND AWARENESS
 
Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...
Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...
Importance of Assessing Level of Consciousness in Medical Care | The Lifescie...
 
Coping with Childhood Cancer - How Does it Hurt Today
Coping with Childhood Cancer - How Does it Hurt TodayCoping with Childhood Cancer - How Does it Hurt Today
Coping with Childhood Cancer - How Does it Hurt Today
 
Mobile Health And Apps (mhealth) How to design Application for medical App.pptx
Mobile Health And Apps (mhealth) How to design Application for medical App.pptxMobile Health And Apps (mhealth) How to design Application for medical App.pptx
Mobile Health And Apps (mhealth) How to design Application for medical App.pptx
 
Globalny raport: „Prawdziwe piękno 2024" od Dove
Globalny raport: „Prawdziwe piękno 2024" od DoveGlobalny raport: „Prawdziwe piękno 2024" od Dove
Globalny raport: „Prawdziwe piękno 2024" od Dove
 
Learn Tips for Managing Chemobrain or Mental Fogginess
Learn Tips for Managing Chemobrain or Mental FogginessLearn Tips for Managing Chemobrain or Mental Fogginess
Learn Tips for Managing Chemobrain or Mental Fogginess
 
Dr Sujit Chatterjee Hiranandani Hospital Kidney.pdf
Dr Sujit Chatterjee Hiranandani Hospital Kidney.pdfDr Sujit Chatterjee Hiranandani Hospital Kidney.pdf
Dr Sujit Chatterjee Hiranandani Hospital Kidney.pdf
 
Field exchange, Issue 72 April 2024 FEX-72.pdf
Field exchange, Issue 72 April 2024 FEX-72.pdfField exchange, Issue 72 April 2024 FEX-72.pdf
Field exchange, Issue 72 April 2024 FEX-72.pdf
 
Clinical Education Presentation at Accelacare
Clinical Education Presentation at AccelacareClinical Education Presentation at Accelacare
Clinical Education Presentation at Accelacare
 
FAMILY in sociology for physiotherapists.pptx
FAMILY in sociology for physiotherapists.pptxFAMILY in sociology for physiotherapists.pptx
FAMILY in sociology for physiotherapists.pptx
 

Chapter3

  • 2. Outlines • Unified Modeling Language • Structure Diagrams • Modeling Behavior
  • 3. UML Diagrams • UML recognizes 13 diagram types, although most users of UML make do using three or four types of diagram, depending on what they are using it for.
  • 4. UML Diagrams • UML recognizes 13 diagram types, although most users of UML make do using three or four types of diagram, depending on what they are using it for.
  • 5. UML class diagrams 5  UML class diagram: a picture of the classes in an OO system, their fields and methods, and connections between the classes that interact or inherit from each other details of how the classes interact with each other algorithmic details; how a particular behavior is implemented.
  • 6. Diagram of one class • class name in top of box – write <<interface>> on top of interfaces' names – use italics for an abstract class name • attributes (optional) – should include all fields of the object • operations / methods (optional) – may omit trivial (get/set) methods • but don't omit any methods from an interface! – should not include inherited methods 6
  • 7. Class attributes • attributes (fields, instance variables) – visibility name : type [count] = default_value – visibility: + public # protected - private ~ package (default) / derived – underline static attributes – derived attribute: not stored, but can be computed from other attribute values – attribute example: - balance : double = 0.00 7
  • 8. Class operations / methods • operations / methods – visibility name (parameters) : return_type – visibility: + public # protected - private ~ package (default) – underline static methods – parameter types listed as (name: type) – omit return_type on constructors and when return type is void – method example: + distance(p1: Point, p2: Point): double 8
  • 9. Comments • represented as a folded note, attached to the appropriate class/method/etc by a dashed line 9
  • 10. Relationships btwn. classes • generalization: an inheritance relationship – inheritance between classes – interface implementation • association: a usage relationship – dependency – aggregation – composition 10
  • 11. Generalization relationships • Generalization (Inheritance) Relationships – Hierarchies Drawn Top-down With Arrows Pointing Upward To Parent – Line/Arrow Styles Differ, Based On Whether Parent Is A(n): • Class: Solid Line, Black Arrow • Abstract Class: Solid Line, White Arrow • Interface: Dashed Line, White Arrow – We Often Don't Draw Trivial / Obvious Generalization Relationships, Such As Drawing The Object Class As A Parent 11
  • 12. Associational relationships • Associational (Usage) Relationships 1. Multiplicity (How Many Are Used) • *  0, 1, Or More • 1  1 Exactly • 2..4  Between 2 And 4, Inclusive • 3..*  3 Or More 2. Name (What Relationship The Objects Have) 3. Navigability (Direction) 12
  • 13. Multiplicity of associations 13  one-to-one  each student must carry exactly one ID card  one-to-many  one rectangle list can contain many rectangles
  • 15. Class diagram example 2 15 DVD Movie VHS Movie Video Game Rental Item Rental Invoice 1..* 1 Customer Checkout Screen 0..1 1 Simple Association Class Abstract Class Simple Aggregation Generalization Composition Multiplicity
  • 16. Class diagram example 3 16 StudentBody + main (args : String[]) + toString() : String 1 100 Student - firstName : String - lastName : String - homeAddress : Address - schoolAddress : Address + toString() : String - streetAddress : String - city : String - state : String - zipCode : long Address
  • 17. Class design exercise • Consider this Texas Hold 'em poker game system: – 2 to 8 human or computer players – Each player has a name and stack of chips – Computer players have a difficulty setting: easy, medium, hard – Summary of each hand: • Dealer collects ante from appropriate players, shuffles the deck, and deals each player a hand of 2 cards from the deck. • A betting round occurs, followed by dealing 3 shared cards from the deck. • As shared cards are dealt, more betting rounds occur, where each player can fold, check, or raise. • At the end of a round, if more than one player is remaining, players' hands are compared, and the best hand wins the pot of all chips bet so far. 17
  • 18. Class design exercise – Draw a class diagram for this system. Include relationships between classes (generalization and associational). 18
  • 19. UML Modeling Behavior 19  Use Case: a picture of the classes in an OO system, their fields and methods, and connections between the classes that interact or inherit from each other details of how the classes interact with each other algorithmic details; how a particular behavior is implemented.
  • 20. Use Cases • The use case is a summary of scenarios for a single task or goal. • So What is the Use Case???? • The Use Case is Make Appointment. • It is a use case for the medical clinic.
  • 21. Use Cases • The picture below is a Make Appointment use case for the medical clinic. • The actor is a Patient. The connection between actor and use case is a communication association (or communication for short). Actors are stick figures. Use cases are ovals. Communications are lines that link actors to use cases.
  • 22. Use Case Components • The use case has three components. • The use case task referred to as the use case that represents a feature needed in a software system. • The actor(s) who trigger the use case to activate. • The communication line to show how the actors communicate with the use case.
  • 23. Use Case Diagram - Use Case • A major process performed by the system that benefits an actor(s) in some way • Models a dialogue between an actor and the system • Represents the functionality provided by the system
  • 24. Use Case • Each use case in a use case diagram describes one and only one function in which users interact with the system – May contain several “paths” that a user can take while interacting with the system – Each path is referred to as a scenario
  • 25. Use Case • Labelled using a descriptive verb-noun phrase • Represented by an oval Make Appointment Make Appointment
  • 26. Use Case - Actor • Labelled using a descriptive noun or phrase • Represented by a stick character
  • 27. Use Case - Relationships • Relationships – Represent communication between actor and use case – Depicted by line or double-headed arrow line – Also called association relationship Make Appointment
  • 28. Use Case - Relationships • Boundary – A boundary rectangle is placed around the perimeter of the system to show how the actors communicate with the system. Make Appointment
  • 29. Guidelines for Creating Use-Case Diagrams – Order messages from left to right, top to bottom • Name actors and objects the same if they represent the same idea • Place the initiator of the scenario on the left of the diagram • Multiple objects of the same class: name each • Only show return values when they are not obvious • Justify messages near the arrowhead for improved readability
  • 30. Use-Case Diagram A use case diagram is a collection of actors, use cases, and their communications.
  • 32. State Machine Software Design (UML) • An object must be in some specific state at any given time during its lifecycle. • An object transitions from one state to another as the result of some event that affects it. • You may create a state diagram for any class, collaboration, operation, or use case in a UML model . • There can be only one start state in a state diagram, but there may be many intermediate and final states.
  • 34. Components of State Machines • States—values of an object’s attributes at a point in time • Events—the cause of the change in values of the object’s attributes • Transitions—movement of an object from one state to another – May include a guard condition to flag that a condition is true and allow the transition
  • 36. State Machine Software Design (UML) selecting verifying downloading checking schedule download course offerings make a course selection verify selection check schedule select another course make a different selection unscheduled scheduled sign schedule
  • 37. Guidelines for Creating Behavioral State Machines • Use only for complex objects • Draw the initial state in the upper left corner • Draw the final state in the bottom right corner • Use simple, but descriptive names for states • Look out for “black holes” and “miracles” • Ensure guard conditions are mutually exclusive • Ensure transitions are associated with messages and operations
  • 38. Building a Behavioral State Machine • Set the context • Identify the states of the object • Initial • Final • Stable states during its lifetime • Lay out the diagram—use a left to right sequence • Add the transitions • Identify the triggers (events that cause the transition) • Identify the actions which execute • Identify the guard conditions • Validate the model—ensure all states are reachable
  • 39. UML Modeling Behavior 39  Sequence Diagram: Sequence Diagram is a diagram that depicts object interactions arranged in time sequence, where the direction of time is down the page. The objects, which exchange information, are shown at the top of a vertical line or bar, known as the object’s lifeline. An arrow between the lifelines of two objects represents each message.
  • 42. Sequence Diagram Software Design (UML) An object in a sequence diagram is rendered as a box with a dashed line descending from it. The line is called the object lifeline, and it represents the existence of an object over a period of time. an Order Line
  • 43. Sequence Diagram Software Design (UML) an Order Line a Stock Item [check = “true”] remove() check() Messages are rendered as horizontal arrows being passed from object to object as time advances down the object lifelines. Conditions ( such as [check = “true”] ) indicate when a message gets passed.
  • 44. Sequence Diagram Software Design (UML) an Order Line a Stock Item [check = “true”] remove() check() Notice that the bottom arrow is different. The arrow head is not solid, and there is no accompanying message. This arrow indicates a return from a previous message, not a new message.
  • 45. Sequence Diagram Software Design (UML) an Order a Order Line * prepare() An iteration marker, such as * (as shown), or *[i = 1..n] , indicates that a message will be repeated as indicated. Iteration marker
  • 47.
  • 48. Building Sequence Diagrams • Set the context • Identify actors and objects that interact in the use-case scenario • Set the lifeline for each object • Add messages by drawing arrows • Shows how they are passed from one object to another • Include any parameters in parentheses • Obvious return values are excluded • Add execution occurrence to each object’s lifeline • Validate the sequence diagram • Ensures that it depicts all of the steps in the process
  • 49. Thank for your listening

Notes de l'éditeur

  1. This allows information to be omitted from any diagram in order to make it easier to understand. The corollary is that you should never infer anything from the absence of information in a diagram and that UML diagrams should not be read on their own without access to the rest of the model.
  2. This allows information to be omitted from any diagram in order to make it easier to understand. The corollary is that you should never infer anything from the absence of information in a diagram and that UML diagrams should not be read on their own without access to the rest of the model.
  3. Use Case Represent the user functionality (not system functionality)
  4. Use Case In reading a use case, you should not be able to tell if an activity is computerized or manual Used to document the current system (AS-IS system) or the new system being developed (TO-BE system) Communicates at a high level what the system needs to do Captures the typical interaction of the system with the system’s users Logical model Physical details are defined during the design phase
  5. Use case: A use case in a use case diagram is a visual representation of a distinct business functionality in a system. The key term here is "distinct business functionality." To choose a business process as a likely candidate for modeling as a use case, you need to ensure that the business process is discrete in nature. As the first step in identifying use cases, you should list the discrete business functions in your problem statement. Each of these business functions can be classified as a potential use case. Remember that identifying use cases is a discovery rather than a creation. As business functionality becomes clearer, the underlying use cases become more easily evident. A use case is shown as an ellipse in a use case diagram Depicted by an oval MUST label the oval with the name of the use case
  6. Actors: An actor portrays any entity (or entities) that performs certain roles in a given system. The different roles the actor represents are the actual business roles of users in a given system. An actor in a use case diagram interacts with a use case. For example, for modeling a banking application, a customer entity represents an actor in the application. Similarly, the person who provides service at the counter is also an actor. But it is up to you to consider what actors make an impact on the functionality that you want to model. If an entity does not affect a certain piece of functionality that you are modeling, it makes no sense to represent it as an actor. An actor is shown as a stick figure in a use case diagram depicted "outside" the system boundary, as shown in Make Appointment figure. Depicted by an oval MUST label the oval with the name of the use case To identify an actor, search in the problem statement for business terms that portray roles in the system. For example, in the statement "patients visit the doctor in the clinic for medical tests," "doctor" and "patients" are the business roles and can be easily identified as actors in the system.
  7. Use Case Relationship Association relationship May exist between actor and a use case Often referred to as a communicate association Navigable in both directions (actor to use case and use case to actor) Some use just a line Others use a double-headed arrowhead Navigable in only one direction (actor to use case OR use case to actor) Use a arrowhead where arrowhead denotes the direction of communication Navigation direction of an association represents who is initiating the communication Multiplicity Not consistency shown on all use-case diagrams (Some do; some don’t)
  8. System boundary: A system boundary defines the scope of what a system will be. A system cannot have infinite functionality. So, it follows that use cases also need to have definitive limits defined. A system boundary of a use case diagram defines the limits of the system. The system boundary is shown as a rectangle spanning all the use cases in the system. Other use cases in this lecture also show the system boundary of the clinic application. The use cases of this system are enclosed in a rectangle. Note that the actors in the system are outside the system boundary. The system boundary is potentially the entire system as defined in the problem statement. But this is not always the case. For large and complex systems, each of the modules may be the system boundary. For example, for an ERP system for an organization, each of the modules such as personnel, payroll, accounting, and so forth, can form the system boundary for use cases specific to each of these business functions. The entire system can span all of these modules depicting the overall system boundary.
  9. Example Use Case ACTORS Represented by a stick figure named USE CASE Represented by an oval Named (POORLY NAMED; should be verb phrase) RELATIONSHIP 2-way association
  10. System Boundary Use cases are enclosed within a system boundary a box that represents the system and clearly delineates what parts of the diagram are external or internal to it Name of the system can appear inside or on top of the box