SlideShare a Scribd company logo
1 of 75
Download to read offline
Unified Modeling LanguageUnified Modeling Language
Preeti Mishra
Course Instructor
Object Modelling Using
UML
UML is a modelling language.
 Not a system design or development
methodology
Used to document object-oriented analysis and
design results.
Independent of any specific design methodology.
UML Origin
OOD in late 1980s and early 1990s:
 Different software development houses were
using different notations.
 Methodologies were tied to notations.
UML developed in early 1990s:
 To standardize the large number of object-
oriented modelling notations that existed.
UML Lineology
Based Principally on:
 OMT [Rumbaugh 1991]
 Booch’s methodology[Booch 1991]
 OOSE [Jacobson 1992]
 Odell’s methodology[Odell 1992]
 Shlaer and Mellor [Shlaer 1992]
Different Object Modeling
Techniques in UML
UML
Booch’s
Methodolog
y
OOSE
OMT
UML as A Standard
Adopted by Object Management Group (OMG)
in 1997.
OMG is an association of industries
Promotes consensus notations and
techniques
UML also being used outside software
development area:
 Example car manufacturing
History of UML
Industrialization
Standardization
Unification
Fragmentation
Other methods Booch'91 OMT-1 OOSE
Booch'93 OMT-2
UML 0.9 & 0.91
Unified method 0.8
UML 0.9 & 0.91
UML 1.1
public
feedbac
k
UML 2.0
Developments to UML
• UML continues to
develop:
– Refinements
– Making it applicable
to new contexts
UML 1.X
UML 1.0
UML 2.0
Application
to
embedded
systems
1997
2003
Why are UML Models
Required?
Modelling is an abstraction mechanism:
 Capture only important aspects and ignores the
rest.
 Different models result when different aspects are
ignored.
 An effective mechanism to handle complexity.
UML is a graphical modelling tool
Easy to understand and construct
Modeling a House
Why do we model
• Models help us to visualize a system as it is or as we
want it to be.
• Models permit us to specify the structure or behavior of
a system.
• Models give us a template that guides us in
constructing a system.
• Models document the decisions we have made.
UML Diagrams
Nine diagrams in UML1.x :
 Used to capture 5 different views of a system.
Views:
 Provide different perspectives of a software
system.
Diagrams can be refined to get the actual
implementation of a system.
UML Model Views
Views of a system:
 User’s view
 Structural view
 Behavioral view
 Implementation view
 Environmental view
UML Diagrams
User’s View
- Use Case
Diagram
Structural View
- Class Diagram
- Object Diagram
Implementation View
- Component Diagram
Environmental View
- Deployment Diagram
Behavioural View
- Sequence Diagram
- Collaboration Diagram
- State-chart Diagram
- Activity Diagram
Diagrams and views in UML
Diagrams in the UML 2.0 -- 13 Diagrams
UML 2.0 Diagrams
UML 2.0
Diagram
Behavior
Diagram
Structure
Diagram
Class
Diagram
Composite
Structure Diagram
Object
Diagram
Activity
Diagram
Use Case
Diagram
State Machine
Diagram
Interaction
Diagram
Component
Diagram
Deployment
Diagram
Package
Diagram
Sequence
Diagram
Communication
Diagram
Interaction
Overview
Diagram
Timing
Diagram
Structural Diagrams
• Class Diagram
– set of classes and their relationships.
• Object Diagram
– set of objects (class instances) and their relationships
• Component Diagram
– logical groupings of elements and their relationships
• Deployment Diagram
– set of computational resources (nodes) that host each
component.
Behavioral Diagrams
• Use Case Diagram
– high-level behaviors of the system, user goals, external entities:
actors
• Sequence Diagram
– focus on time ordering of messages
• Collaboration Diagram
– focus on structural organization of objects and messages
• State Chart Diagram
– event driven state changes of system
• Activity Diagram
– flow of control between activities
Quotable Quotes on Using UML
• “UML is a large and growing beast, but you don’t
need all of it in every problem you solve…”
– Martin Fowler
• The Unified Modeling Language is described as a language for
“specifying, visualizing, constructing, and documenting the artifacts of
software systems” and for business modeling (OMG UML V1.x
documents). The UML reflects some of the best experiences in object-
oriented modeling, thus it has the potential to become a widely-used
standard object-oriented modeling language.
• Robert France, Bernhard Rumpe
Are All Views Required for
Developing A Typical System?
NO
For a simple system:
 Use case diagram, class diagram and one of the
interaction diagrams only.
State chart diagram:
 when class has significant states.
 When states are only one or two, state chart model
becomes trivial
Deployment diagram:
 In case several hardware components used to
develop the system.
• In groups:
– History of: OMT, OOSe, Odell’s Methodolgy
Shlaer & Mellor, Limitations and
advantages of UML
Everyone individually:
• Current version of uml
• Tools used for UML by various vendors
Have a look at the tool
Key Diagrams in UML
Requirements
System
Structure
System
Behaviour
Use Case Diagrams
Interaction Diagrams
Activity Diagrams
State Charts
Class Diagrams
Collaboration Diagram
Use Case ModellingUse Case Modelling
Use Case Model
• Consists of a set of “use cases”
• It is the central model:
– Other models must conform to this model
– Not really an object-oriented model
– A functional model of the system
A Use Case
• A way in which a system can be used by the
users to achieve specific goals
• Corresponds to a high-level requirement.
• Defines external behavior without revealing
internal structure of system
• Set of related scenarios tied together by a
common goal.
Use Cases Cont…
• Normally, use cases are independent
of each other
• Implicit dependencies may exist
• Example: In Library Automation
System, renew-book and reserve-book
are independent use cases.
–But in actual implementation of renew-
book--- A check is made to see if any book
has been reserved using reserve-book.
Example Use Cases
–Library information system
•issue-book
•query-book
•return-book
•create-member
•add-book, etc.
Representation of Use Cases
• Represented in a use case diagram
• A use case is represented by an ellipse
• System boundary is represented by a
rectangle
• Users are represented by
stick person icons (actor)
• Communication relationship between
actor and use case by a line
• External system by a stereotype
Tic-tac-toe game
Play Move
What is a Connection?
• A connection is an association
between an actor and a use case.
• Depicts a usage relationship
• Connection does not indicate data
flow
Tic-tac-toe game
Play Move
Effective Use Case
Modelling
• Use cases should be named and
organized from the perspective of the
actor.
• Use cases should start off simple and
at as much high view as possible.
– Can be refined and detailed further.
• Use case diagrams represent
functionality:
– Should focus on the "what" and not the
An Example Use Case
Diagram
Use case model
Tic-tac-toe game
Play Move
Player
Relationships between Use Cases
and Actors
• Actors may be connected to a
use case by association relation:
–Indicating that the actor and the
use case communicate with one
another.
update
grades
faculty
Another Example Use Case
Diagram
Rent
Videos
. . .
Video Store
Information System
<<external
system>>
Credit Authorization
Service
Clerk
Yet Another Use Case Example
Check
Status
Place
Order
Fill Orders
Establish
credit
Customer
Salesperso
n
Shipping
Clerk
Supervisor
Telephone Catalog
Why Develop A Use Case Diagram?
• Serves as requirements specification
• How are actor identification useful in
software development?
–Identifies different categories of users:
• Helps in implementing appropriate
interfaces for each category of users.
–Helps in preparing appropriate
documents (e.g. user’s manual).
Use Case Description: Change
Flight
 Actors: traveler
 Preconditions:
 Traveler has logged on to the system and selected
‘change flight itinerary’ option
 Basic course
1. System retrieves traveler’s account and flight itinerary
from client account database
2. System asks traveler to select itinerary segment she
wants to change; traveler selects itinerary segment.
3. System asks traveler for new departure and
destination information; traveler provides information.
4. If flights are available then
5. …
6. System displays transaction summary.
 Alternative courses
4. If no flights are available then …
ATM Money Withdraw Example
• Actors: Customer
• Pre Condition:
– The ATM must be in a state ready to accept transactions
– The ATM must have at least some cash on hand that it
can dispense
– The ATM must have enough paper to print a receipt for
at least one transaction
• Post Condition:
– The current amount of cash in the user account is the
amount before the withdraw minus the withdraw
amount
– A receipt was printed on the withdraw amount
– The withdraw transaction was audit in the System log
file
ATM Money Withdraw Mainline
Scenario
Actor Actions System Actions
1. Begins when a Customer
arrives at ATM
2. Customer inserts a Credit
card into ATM
3. System verifies the customer
ID and status
5. Customer chooses
“Withdraw” operation
4. System asks for an operation
type
7. Customer enters the cash
amount
6. System asks for the withdraw
amount
8. System checks if withdraw
amount is legal
9. System dispenses the cash
10. System deduces the
withdraw amount from account
11. System prints a receipt
13. Customer takes the cash
and the receipt
12. System ejects the cash card
ATM Money Withdraw (cont.)
• Alternative flow of events:
– Step 3: Customer authorization failed. Display an
error message, cancel the transaction and eject the
card.
– Step 8: Customer has insufficient funds in its
account. Display an error message, and go to step 6.
– Step 8: Customer exceeds its legal amount. Display
an error message, and go to step 6.
• Exceptional flow of events:
– Power failure in the process of the transaction before
step 9, cancel the transaction and eject the card
Identification of Use Cases
1. Actor-based:
- Identify the actors related to a system or
organization.
- For each actor, identify the processes they
initiate or participate in.
2. Event-based
- Identify the external events that the
system must respond to.
- Relate the events to actors and use cases.
Factoring Use Cases
• Two main reasons for factoring:
–Complex use cases need to be factored
into simpler use cases
–To represent common behavior across
different use cases
• Three ways of factoring:
–Generalization
–Include
–Extend
Generalization
• The child use case inherits the
behavior of the parent use
case.
–The child may add to or override
the behavior of its parent. parent
child
Registratio
n
Graduate
registration
Under-
graduate
registration
Generalization Example 1
Factoring Use Cases Using
Generalization
Pay membership fee
Pay through library pay cardPay through credit card
Factoring Use Cases Using
Include
Base use case
Common
use case
<<include>>
Base use case 2
Common use case 3Common use case 2Common use case 1
Base use case 1
<<include>>
<<include>>
<<include>>
<<include>>
Example of Factoring Use Cases
Using Includes
Issue Book
Check Reservation
Renew Book
<<include>>
<<include>>
Factoring Use Cases Using
Extends
Base
use case
Common
use case
<<extend>>
Factoring Use Cases Using
Extends
Order
Item
Show
Catalog
<<extend>>
Extension Point
• The base use case can incorporate
another use case:
– at certain points, called extension
points.
• Note the direction of the arrow
Perform
Sale
After
checkout
Gift wrap
Product
<<extend>>
Product is a gift
Use Case Relationships
Place Order
Supply
Customer
Data
Order
Produc
t Arrange
Paymen
t
Request
Catalog
<<include>
>
<<include>
> <<include>
>
<<extend>
>
The salesperson asks for
catalog
Sales
Person
Cash
Paymen
t
Credit
Paymen
t
Hierarchical Organization of
Use Cases
External usersuse case 1
use case 2
use case 3
use case 3.1
use case 3. 2
use case 3.3
use case 1
use case 2
use case 3
Subsystems
Methods
Use Case Relationships
Place Order
Extension point
Additional requests:
After creation of the
order
Supply
Customer
Data
Order
Produc
t Arrange
Paymen
t
Request
Catalog
<<include>
>
<<include>
>
<<include>
>
<<extend>
>
The salesperson asks for
catalog
Sales
Person
Too many use
cases at any level
is avoidable!
Use Case Packaging
Query balance
Receive
grant
Print
Balance sheet
Make
payments
Accounts
Use-Case Model using
Packaging
Use Cases of Order Entry Subsystem
Use Case Description
Name
Actors
Preconditions
Post conditions
Success Scenario
Alternatives flows
Alistair Cockburn
“Writing
Effective Use
Cases”
Trigger
Triggers
• What starts use-case?
• Examples:
–Customer initiates a claim report by
clicking a button on a web page
–Customer inserts ATM card
–System clock is 10:00
–etc.
Preconditions
• What the system needs to be true
before running the use-case.
• Examples
–The use has logged on
–Requested Book is issued out
–User account has been created
–The membership has expired
Post-Conditions
• A post-condition is the outcome of a use-case.
• Examples
– Money was transferred to the user account
– User is logged in
– The file is saved to the hard-disk
• Minimal guarantee
– The things that a system can promise, holding even when
the use case execution ended in failure
– Examples: Money is not transferred unless authorization is
granted by the user
• Success guarantee
– What happens after a successful conclusion of the use-case.
– Example: Transaction logged; Money is transferred
Success Scenario
• The success scenario is the main story-
line of the use-case
– Under the assumption that everything is
okay, no errors or problems occur
• It is composed of a sequence of action
steps
1. Administrator enters course name, code and description
2. System validates course code
3. System adds the course to the db and shows a confirmation
message
Interaction
step
Validation
Step
Internal
Change Step
Interaction
Step
Guidelines for Effective Writing
• Use simple sentence
• Do not have both system and
actor doing something in a
single step
– Bad: “Get the amount from the
user and give him the receipt.”
• Any step should lead to some
progress
– Bad: “User clicks a key”
System Actor
Actor asks for money
System asks for amount
Actor gives the amount
System produce the money
Recruit
Employee
Update
Employee
Profile
Update
Benefits
Access
Travel
System
Access Pay
Records
Employee
Manager
Healthcare
Plan System
Insurance
Plan System
Online HR System
Example: Online HR System
Online HR System: Use Case
Relationships
Employee
Update
Benefits
Extension points
benefit options :
After required
enrollments
Update
Medical Plan
Update
Dental Plan Update
Insurance
Plan
Elect
Reimbursement
for health care
Elect stock
purchase
<<include>
>
<<include>
>
<<include>
>
<<extend>>
<<extend>>
Employee requests
reimbursement options
Employee requests stock
purchase options
Extension
condition
Extension point
name and location
Online HR System: Update Benefits Use Case
Actors: employee, employee account db, healthcare plan
system, insurance plan system
Preconditions:
 Employee has logged on to the system and selected
‘update benefits’ option
Basic course
 System retrieves employee account from employee
account db
 System asks employee to select medical plan type;
include Update Medical Plan.
 System asks employee to select dental plan type; include
Update Dental Plan.
 …
Alternative courses
 If health plan is not available in the employee’s area the
employee is informed and asked to select another plan...
Style Notes (Ambler,
2005)
• Use case name should begin with a verb.
• While use cases do not imply timing:
– Order cases from top to bottom to imply timing -- it improves
readability.
• The primary actors should appear in the left.
• Actors are associated with one or more use cases.
• Do not use arrows on the actor-use case relationship.
• To initiate scheduled events include an actor called “time”
• Do not show actors interacting with each other.
• <<include>> should rarely nest more than 2 deep.
Exercise 1: Use Case Model for Course Management Software
• At the beginning of each semester,
– Professors shall register the courses that they are going
to teach.
• A student can select up to four-course offerings.
– During registration a students can request a course
catalogue showing course offerings for the semester.
– Information about each course such as professor,
department and prerequisites would be displayed.
– The registration system sends information to the billing
system so the students can be billed for the semester.
• For each semester, there is a period of time during
which dropping of courses is permitted.
• Professors must be able to access the system to see
which students signed up for each of their course
offerings.
Register
offering
Show
registratio
n
Register
course
Drop
Course
Student
{ if today<set date }
Calendar
Course Management
Software
Exercise 1: Answer
{ reg courses< 5
courses}
See
Course
List
Faculty
<<Extend>>
<<External>
>
Billing System
Exercise 2: Home Assignment System
• HAS will be used by the instructor to:
– Distribute the homework assignments,
– Review the students’ solutions,
– Distribute suggested solution,
– Assign grade to each assignment.
• Students can:
– Download assignments
– Submit assignment solutions
• System:
– Automatically reminds the students a day before an
assignment is due.
HAS Use Case Diagram
Distribute
Assignments
Post
Solutions
Distribute
GradeInstructor
Remind
Student
Calendar
<<Extends>>
Get
Assignment
Submit
Assignment
Get
Solution
Get Grade
Student
Alternate HACS Use Case Diagram
Distribute
Assignments
Post
Solutions
Distribute
Grade
Instructor
Remind
Student
Calendar
Submit
Assignment
Student

More Related Content

What's hot

Data and functional modeling
Data and functional modelingData and functional modeling
Data and functional modeling
Slideshare
 

What's hot (19)

Oo concepts and class modeling
Oo concepts and class modelingOo concepts and class modeling
Oo concepts and class modeling
 
Analysis modeling & scenario based modeling
Analysis modeling &  scenario based modeling Analysis modeling &  scenario based modeling
Analysis modeling & scenario based modeling
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
architectural design
 architectural design architectural design
architectural design
 
Uml diagrams
Uml diagramsUml diagrams
Uml diagrams
 
Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram
 
Uml
UmlUml
Uml
 
Structural modeling and analysis
Structural modeling and analysisStructural modeling and analysis
Structural modeling and analysis
 
Data and functional modeling
Data and functional modelingData and functional modeling
Data and functional modeling
 
Arch06 1
Arch06 1Arch06 1
Arch06 1
 
Functional modeling
Functional modelingFunctional modeling
Functional modeling
 
Introducing Uml And Development Process
Introducing Uml And Development ProcessIntroducing Uml And Development Process
Introducing Uml And Development Process
 
Modeling software architecture with uml
Modeling software architecture with umlModeling software architecture with uml
Modeling software architecture with uml
 
Unit 1- OOAD ppt
Unit 1- OOAD  pptUnit 1- OOAD  ppt
Unit 1- OOAD ppt
 
4 sdlc
4 sdlc4 sdlc
4 sdlc
 
Use case diagram
Use case diagramUse case diagram
Use case diagram
 
An Automatic Approach to Translate Use Cases to Sequence Diagrams
An Automatic Approach to Translate Use Cases to Sequence DiagramsAn Automatic Approach to Translate Use Cases to Sequence Diagrams
An Automatic Approach to Translate Use Cases to Sequence Diagrams
 
Use case diagrams
Use case diagramsUse case diagrams
Use case diagrams
 
SMD Unit ii
SMD Unit iiSMD Unit ii
SMD Unit ii
 

Similar to Uml intro

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
 
Software Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdfSoftware Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdf
MeagGhn
 

Similar to Uml intro (20)

OOAD U1.pptx
OOAD U1.pptxOOAD U1.pptx
OOAD U1.pptx
 
SELECT21.pptx
SELECT21.pptxSELECT21.pptx
SELECT21.pptx
 
analysis and design with uml
analysis and design with umlanalysis and design with uml
analysis and design with uml
 
graph
graphgraph
graph
 
Lab 3 Introduction to the UML - how to create a use case diagram
Lab 3 Introduction to the UML - how to create a use case diagramLab 3 Introduction to the UML - how to create a use case diagram
Lab 3 Introduction to the UML - how to create a use case diagram
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Unit-II(STATIC UML DIAGRAMS).ppt
Unit-II(STATIC UML DIAGRAMS).pptUnit-II(STATIC UML DIAGRAMS).ppt
Unit-II(STATIC UML DIAGRAMS).ppt
 
Use Case Diagram.pptx
Use Case Diagram.pptxUse Case Diagram.pptx
Use Case Diagram.pptx
 
Use case modeling
Use case modelingUse case modeling
Use case modeling
 
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
UmlUml
Uml
 
uml.ppt
uml.pptuml.ppt
uml.ppt
 
Presentation Use Case Diagram and Use Case Specification.pptx
Presentation Use Case Diagram and Use Case Specification.pptxPresentation Use Case Diagram and Use Case Specification.pptx
Presentation Use Case Diagram and Use Case Specification.pptx
 
RTDesignWithUMLUseCase.ppt
RTDesignWithUMLUseCase.pptRTDesignWithUMLUseCase.ppt
RTDesignWithUMLUseCase.ppt
 
conversion-gate02.pptx
conversion-gate02.pptxconversion-gate02.pptx
conversion-gate02.pptx
 
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
Workshop on Basics of Software Engineering (DFD, UML and Project Culture)
 
Software Engineering : OOAD using UML
Software Engineering : OOAD using UMLSoftware Engineering : OOAD using UML
Software Engineering : OOAD using UML
 
Ch 14 s.e use case diagrams
Ch 14 s.e use case diagramsCh 14 s.e use case diagrams
Ch 14 s.e use case diagrams
 
Software Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdfSoftware Engineering Tools and Practices.pdf
Software Engineering Tools and Practices.pdf
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 

More from Preeti Mishra

More from Preeti Mishra (20)

Effective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labsEffective Ways to Conduct Programming labs
Effective Ways to Conduct Programming labs
 
Object diagram
Object diagramObject diagram
Object diagram
 
Sequence diagrams
Sequence diagramsSequence diagrams
Sequence diagrams
 
State chart diagram
State chart diagramState chart diagram
State chart diagram
 
Unit 8 software quality and matrices
Unit 8 software quality and matricesUnit 8 software quality and matrices
Unit 8 software quality and matrices
 
Unit 7 performing user interface design
Unit 7 performing user interface designUnit 7 performing user interface design
Unit 7 performing user interface design
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
 
requirements analysis and design
requirements analysis and designrequirements analysis and design
requirements analysis and design
 
Design process interaction design basics
Design process interaction design basicsDesign process interaction design basics
Design process interaction design basics
 
Design process design rules
Design process  design rulesDesign process  design rules
Design process design rules
 
Design process evaluating interactive_designs
Design process  evaluating interactive_designsDesign process  evaluating interactive_designs
Design process evaluating interactive_designs
 
Foundations understanding users and interactions
Foundations  understanding users and interactionsFoundations  understanding users and interactions
Foundations understanding users and interactions
 
IntrIntroduction
IntrIntroductionIntrIntroduction
IntrIntroduction
 
Analysis
AnalysisAnalysis
Analysis
 
Software testing part
Software testing partSoftware testing part
Software testing part
 
Object modeling
Object modelingObject modeling
Object modeling
 
Introduction
IntroductionIntroduction
Introduction
 
eUnit 2 software process model
eUnit 2  software process modeleUnit 2  software process model
eUnit 2 software process model
 
Unit 1 importance ofsoftengg_b.tech iii year
Unit 1  importance ofsoftengg_b.tech iii yearUnit 1  importance ofsoftengg_b.tech iii year
Unit 1 importance ofsoftengg_b.tech iii year
 
Unit 1 introduction tosoftengg_mba tech ii year
Unit 1  introduction tosoftengg_mba tech ii yearUnit 1  introduction tosoftengg_mba tech ii year
Unit 1 introduction tosoftengg_mba tech ii year
 

Recently uploaded

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 

Uml intro

  • 1. Unified Modeling LanguageUnified Modeling Language Preeti Mishra Course Instructor
  • 2. Object Modelling Using UML UML is a modelling language.  Not a system design or development methodology Used to document object-oriented analysis and design results. Independent of any specific design methodology.
  • 3. UML Origin OOD in late 1980s and early 1990s:  Different software development houses were using different notations.  Methodologies were tied to notations. UML developed in early 1990s:  To standardize the large number of object- oriented modelling notations that existed.
  • 4. UML Lineology Based Principally on:  OMT [Rumbaugh 1991]  Booch’s methodology[Booch 1991]  OOSE [Jacobson 1992]  Odell’s methodology[Odell 1992]  Shlaer and Mellor [Shlaer 1992]
  • 5. Different Object Modeling Techniques in UML UML Booch’s Methodolog y OOSE OMT
  • 6. UML as A Standard Adopted by Object Management Group (OMG) in 1997. OMG is an association of industries Promotes consensus notations and techniques UML also being used outside software development area:  Example car manufacturing
  • 7. History of UML Industrialization Standardization Unification Fragmentation Other methods Booch'91 OMT-1 OOSE Booch'93 OMT-2 UML 0.9 & 0.91 Unified method 0.8 UML 0.9 & 0.91 UML 1.1 public feedbac k UML 2.0
  • 8. Developments to UML • UML continues to develop: – Refinements – Making it applicable to new contexts UML 1.X UML 1.0 UML 2.0 Application to embedded systems 1997 2003
  • 9. Why are UML Models Required? Modelling is an abstraction mechanism:  Capture only important aspects and ignores the rest.  Different models result when different aspects are ignored.  An effective mechanism to handle complexity. UML is a graphical modelling tool Easy to understand and construct
  • 11. Why do we model • Models help us to visualize a system as it is or as we want it to be. • Models permit us to specify the structure or behavior of a system. • Models give us a template that guides us in constructing a system. • Models document the decisions we have made.
  • 12. UML Diagrams Nine diagrams in UML1.x :  Used to capture 5 different views of a system. Views:  Provide different perspectives of a software system. Diagrams can be refined to get the actual implementation of a system.
  • 13. UML Model Views Views of a system:  User’s view  Structural view  Behavioral view  Implementation view  Environmental view
  • 14. UML Diagrams User’s View - Use Case Diagram Structural View - Class Diagram - Object Diagram Implementation View - Component Diagram Environmental View - Deployment Diagram Behavioural View - Sequence Diagram - Collaboration Diagram - State-chart Diagram - Activity Diagram Diagrams and views in UML
  • 15. Diagrams in the UML 2.0 -- 13 Diagrams
  • 16. UML 2.0 Diagrams UML 2.0 Diagram Behavior Diagram Structure Diagram Class Diagram Composite Structure Diagram Object Diagram Activity Diagram Use Case Diagram State Machine Diagram Interaction Diagram Component Diagram Deployment Diagram Package Diagram Sequence Diagram Communication Diagram Interaction Overview Diagram Timing Diagram
  • 17. Structural Diagrams • Class Diagram – set of classes and their relationships. • Object Diagram – set of objects (class instances) and their relationships • Component Diagram – logical groupings of elements and their relationships • Deployment Diagram – set of computational resources (nodes) that host each component.
  • 18. Behavioral Diagrams • Use Case Diagram – high-level behaviors of the system, user goals, external entities: actors • Sequence Diagram – focus on time ordering of messages • Collaboration Diagram – focus on structural organization of objects and messages • State Chart Diagram – event driven state changes of system • Activity Diagram – flow of control between activities
  • 19. Quotable Quotes on Using UML • “UML is a large and growing beast, but you don’t need all of it in every problem you solve…” – Martin Fowler • The Unified Modeling Language is described as a language for “specifying, visualizing, constructing, and documenting the artifacts of software systems” and for business modeling (OMG UML V1.x documents). The UML reflects some of the best experiences in object- oriented modeling, thus it has the potential to become a widely-used standard object-oriented modeling language. • Robert France, Bernhard Rumpe
  • 20. Are All Views Required for Developing A Typical System? NO For a simple system:  Use case diagram, class diagram and one of the interaction diagrams only. State chart diagram:  when class has significant states.  When states are only one or two, state chart model becomes trivial Deployment diagram:  In case several hardware components used to develop the system.
  • 21. • In groups: – History of: OMT, OOSe, Odell’s Methodolgy Shlaer & Mellor, Limitations and advantages of UML Everyone individually: • Current version of uml • Tools used for UML by various vendors
  • 22. Have a look at the tool
  • 23. Key Diagrams in UML Requirements System Structure System Behaviour Use Case Diagrams Interaction Diagrams Activity Diagrams State Charts Class Diagrams Collaboration Diagram
  • 24. Use Case ModellingUse Case Modelling
  • 25. Use Case Model • Consists of a set of “use cases” • It is the central model: – Other models must conform to this model – Not really an object-oriented model – A functional model of the system
  • 26. A Use Case • A way in which a system can be used by the users to achieve specific goals • Corresponds to a high-level requirement. • Defines external behavior without revealing internal structure of system • Set of related scenarios tied together by a common goal.
  • 27. Use Cases Cont… • Normally, use cases are independent of each other • Implicit dependencies may exist • Example: In Library Automation System, renew-book and reserve-book are independent use cases. –But in actual implementation of renew- book--- A check is made to see if any book has been reserved using reserve-book.
  • 28. Example Use Cases –Library information system •issue-book •query-book •return-book •create-member •add-book, etc.
  • 29. Representation of Use Cases • Represented in a use case diagram • A use case is represented by an ellipse • System boundary is represented by a rectangle • Users are represented by stick person icons (actor) • Communication relationship between actor and use case by a line • External system by a stereotype Tic-tac-toe game Play Move
  • 30. What is a Connection? • A connection is an association between an actor and a use case. • Depicts a usage relationship • Connection does not indicate data flow Tic-tac-toe game Play Move
  • 31. Effective Use Case Modelling • Use cases should be named and organized from the perspective of the actor. • Use cases should start off simple and at as much high view as possible. – Can be refined and detailed further. • Use case diagrams represent functionality: – Should focus on the "what" and not the
  • 32. An Example Use Case Diagram Use case model Tic-tac-toe game Play Move Player
  • 33. Relationships between Use Cases and Actors • Actors may be connected to a use case by association relation: –Indicating that the actor and the use case communicate with one another. update grades faculty
  • 34. Another Example Use Case Diagram Rent Videos . . . Video Store Information System <<external system>> Credit Authorization Service Clerk
  • 35. Yet Another Use Case Example Check Status Place Order Fill Orders Establish credit Customer Salesperso n Shipping Clerk Supervisor Telephone Catalog
  • 36. Why Develop A Use Case Diagram? • Serves as requirements specification • How are actor identification useful in software development? –Identifies different categories of users: • Helps in implementing appropriate interfaces for each category of users. –Helps in preparing appropriate documents (e.g. user’s manual).
  • 37. Use Case Description: Change Flight  Actors: traveler  Preconditions:  Traveler has logged on to the system and selected ‘change flight itinerary’ option  Basic course 1. System retrieves traveler’s account and flight itinerary from client account database 2. System asks traveler to select itinerary segment she wants to change; traveler selects itinerary segment. 3. System asks traveler for new departure and destination information; traveler provides information. 4. If flights are available then 5. … 6. System displays transaction summary.  Alternative courses 4. If no flights are available then …
  • 38. ATM Money Withdraw Example • Actors: Customer • Pre Condition: – The ATM must be in a state ready to accept transactions – The ATM must have at least some cash on hand that it can dispense – The ATM must have enough paper to print a receipt for at least one transaction • Post Condition: – The current amount of cash in the user account is the amount before the withdraw minus the withdraw amount – A receipt was printed on the withdraw amount – The withdraw transaction was audit in the System log file
  • 39. ATM Money Withdraw Mainline Scenario Actor Actions System Actions 1. Begins when a Customer arrives at ATM 2. Customer inserts a Credit card into ATM 3. System verifies the customer ID and status 5. Customer chooses “Withdraw” operation 4. System asks for an operation type 7. Customer enters the cash amount 6. System asks for the withdraw amount 8. System checks if withdraw amount is legal 9. System dispenses the cash 10. System deduces the withdraw amount from account 11. System prints a receipt 13. Customer takes the cash and the receipt 12. System ejects the cash card
  • 40. ATM Money Withdraw (cont.) • Alternative flow of events: – Step 3: Customer authorization failed. Display an error message, cancel the transaction and eject the card. – Step 8: Customer has insufficient funds in its account. Display an error message, and go to step 6. – Step 8: Customer exceeds its legal amount. Display an error message, and go to step 6. • Exceptional flow of events: – Power failure in the process of the transaction before step 9, cancel the transaction and eject the card
  • 41. Identification of Use Cases 1. Actor-based: - Identify the actors related to a system or organization. - For each actor, identify the processes they initiate or participate in. 2. Event-based - Identify the external events that the system must respond to. - Relate the events to actors and use cases.
  • 42. Factoring Use Cases • Two main reasons for factoring: –Complex use cases need to be factored into simpler use cases –To represent common behavior across different use cases • Three ways of factoring: –Generalization –Include –Extend
  • 43. Generalization • The child use case inherits the behavior of the parent use case. –The child may add to or override the behavior of its parent. parent child
  • 45. Factoring Use Cases Using Generalization Pay membership fee Pay through library pay cardPay through credit card
  • 46. Factoring Use Cases Using Include Base use case Common use case <<include>> Base use case 2 Common use case 3Common use case 2Common use case 1 Base use case 1 <<include>> <<include>> <<include>> <<include>>
  • 47. Example of Factoring Use Cases Using Includes Issue Book Check Reservation Renew Book <<include>> <<include>>
  • 48. Factoring Use Cases Using Extends Base use case Common use case <<extend>>
  • 49. Factoring Use Cases Using Extends Order Item Show Catalog <<extend>>
  • 50. Extension Point • The base use case can incorporate another use case: – at certain points, called extension points. • Note the direction of the arrow Perform Sale After checkout Gift wrap Product <<extend>> Product is a gift
  • 51. Use Case Relationships Place Order Supply Customer Data Order Produc t Arrange Paymen t Request Catalog <<include> > <<include> > <<include> > <<extend> > The salesperson asks for catalog Sales Person Cash Paymen t Credit Paymen t
  • 52. Hierarchical Organization of Use Cases External usersuse case 1 use case 2 use case 3 use case 3.1 use case 3. 2 use case 3.3 use case 1 use case 2 use case 3 Subsystems Methods
  • 53. Use Case Relationships Place Order Extension point Additional requests: After creation of the order Supply Customer Data Order Produc t Arrange Paymen t Request Catalog <<include> > <<include> > <<include> > <<extend> > The salesperson asks for catalog Sales Person
  • 54. Too many use cases at any level is avoidable!
  • 55. Use Case Packaging Query balance Receive grant Print Balance sheet Make payments Accounts
  • 57. Use Cases of Order Entry Subsystem
  • 58. Use Case Description Name Actors Preconditions Post conditions Success Scenario Alternatives flows Alistair Cockburn “Writing Effective Use Cases” Trigger
  • 59. Triggers • What starts use-case? • Examples: –Customer initiates a claim report by clicking a button on a web page –Customer inserts ATM card –System clock is 10:00 –etc.
  • 60. Preconditions • What the system needs to be true before running the use-case. • Examples –The use has logged on –Requested Book is issued out –User account has been created –The membership has expired
  • 61. Post-Conditions • A post-condition is the outcome of a use-case. • Examples – Money was transferred to the user account – User is logged in – The file is saved to the hard-disk • Minimal guarantee – The things that a system can promise, holding even when the use case execution ended in failure – Examples: Money is not transferred unless authorization is granted by the user • Success guarantee – What happens after a successful conclusion of the use-case. – Example: Transaction logged; Money is transferred
  • 62. Success Scenario • The success scenario is the main story- line of the use-case – Under the assumption that everything is okay, no errors or problems occur • It is composed of a sequence of action steps 1. Administrator enters course name, code and description 2. System validates course code 3. System adds the course to the db and shows a confirmation message Interaction step Validation Step Internal Change Step Interaction Step
  • 63. Guidelines for Effective Writing • Use simple sentence • Do not have both system and actor doing something in a single step – Bad: “Get the amount from the user and give him the receipt.” • Any step should lead to some progress – Bad: “User clicks a key” System Actor Actor asks for money System asks for amount Actor gives the amount System produce the money
  • 64.
  • 65.
  • 66.
  • 68. Online HR System: Use Case Relationships Employee Update Benefits Extension points benefit options : After required enrollments Update Medical Plan Update Dental Plan Update Insurance Plan Elect Reimbursement for health care Elect stock purchase <<include> > <<include> > <<include> > <<extend>> <<extend>> Employee requests reimbursement options Employee requests stock purchase options Extension condition Extension point name and location
  • 69. Online HR System: Update Benefits Use Case Actors: employee, employee account db, healthcare plan system, insurance plan system Preconditions:  Employee has logged on to the system and selected ‘update benefits’ option Basic course  System retrieves employee account from employee account db  System asks employee to select medical plan type; include Update Medical Plan.  System asks employee to select dental plan type; include Update Dental Plan.  … Alternative courses  If health plan is not available in the employee’s area the employee is informed and asked to select another plan...
  • 70. Style Notes (Ambler, 2005) • Use case name should begin with a verb. • While use cases do not imply timing: – Order cases from top to bottom to imply timing -- it improves readability. • The primary actors should appear in the left. • Actors are associated with one or more use cases. • Do not use arrows on the actor-use case relationship. • To initiate scheduled events include an actor called “time” • Do not show actors interacting with each other. • <<include>> should rarely nest more than 2 deep.
  • 71. Exercise 1: Use Case Model for Course Management Software • At the beginning of each semester, – Professors shall register the courses that they are going to teach. • A student can select up to four-course offerings. – During registration a students can request a course catalogue showing course offerings for the semester. – Information about each course such as professor, department and prerequisites would be displayed. – The registration system sends information to the billing system so the students can be billed for the semester. • For each semester, there is a period of time during which dropping of courses is permitted. • Professors must be able to access the system to see which students signed up for each of their course offerings.
  • 72. Register offering Show registratio n Register course Drop Course Student { if today<set date } Calendar Course Management Software Exercise 1: Answer { reg courses< 5 courses} See Course List Faculty <<Extend>> <<External> > Billing System
  • 73. Exercise 2: Home Assignment System • HAS will be used by the instructor to: – Distribute the homework assignments, – Review the students’ solutions, – Distribute suggested solution, – Assign grade to each assignment. • Students can: – Download assignments – Submit assignment solutions • System: – Automatically reminds the students a day before an assignment is due.
  • 74. HAS Use Case Diagram Distribute Assignments Post Solutions Distribute GradeInstructor Remind Student Calendar <<Extends>> Get Assignment Submit Assignment Get Solution Get Grade Student
  • 75. Alternate HACS Use Case Diagram Distribute Assignments Post Solutions Distribute Grade Instructor Remind Student Calendar Submit Assignment Student