Professional Documents
Culture Documents
Module - 7: Object Oriented Modeling - 32536
Module - 7: Object Oriented Modeling - 32536
Module - 7: Object Oriented Modeling - 32536
• Introduction to Actors
Object Oriented Modeling • Introduction to Use Cases
- 32536 • Use case Variations
• Behavioural modellling with Use Case
Module - 7 Diagrams
• Relationships in Use case diagrams
Requirements Modelling with Use cases
and User Stories (POOA-Chapter 4);
Use case diagram (POOA-Chapter 5)
Who is an Actor?
Sub-Module • The User of the system is usually the Actor
• The Actor (and not the User) is shown sending
and receiving messages to and from the System
Actors – Example: John the Branch Manager, John the Customer and John
the Teller may be one and the same person
1
Actor: Variations Abstract versus Concrete Actors and a corresponding Actor
• Primary versus Secondary Actors: hierarchy in Hospital Management System
Primary: - The first or main Actor who uses the system (e.g. Teller)
- The main Actor who benefits from the system (e.g. Customer)
Secondary: - The Actor who derives indirect benefits from or uses the system
A10-Patient A50-Staff
(e.g. Branch manager); Depends on Perspective
Documenting Actors
Actor versus Class Confusion (Only for Important / Complex Actors)
– Actor Thumbnail
• <Name and Optionally Number for the Actor>
– Actor Type, Stereotype, Package
• <Actor Type – Primary or Secondary; Human or Device etc;
Stereotype and Package may optionally be added>
Patient
– Actor Description
' • <A line or two providing more details of the Actor>
ActorPatient – Actor Relationship
or A10-Patient • <With Use cases; Other Actors, esp. when Inheriting; >
– Interface Specifications
• <Name of the Interface>
– Author & History
• <Original Author and Modifiers of this Actor Documentation>
– Reference Material
• <Relevant reference materials and sources for details>
"Copyright Practical OO Analysis, 9 "Copyright Practical OO Analysis, 10
Thomson Publishing, 2005". Thomson Publishing, 2005".
2
Sources of Use Cases
Notation for a Use case
• User Workshops
– Following the Joint Application Design style
– Play acting various Scenarios with Users
This is the notation – Critical Requirements Analysis
for a use case
• Formal and Informal Problem Statements
UC30-BooksConsultation • Knowledge of Domain Experts
• Interviews and Discussions
• Existing Systems (esp. Legacy)
• Use Case Patterns/Published Literature/ URLs
Insert Card
Read stripe; Request PIN • The Flow within a Use case is the Behavioral
Ask Withdraw/Deposit/Enquiry aspect of the System
Choose Withdraw • This flow can be documented by either:
Dispense Cash – Organized Text (almost Mandatory) that describes the
Take Cash
interactions of the Actor and the System
– Activity diagrams that depict the flow of a use case
Essential Use Case
3
Template: Documenting Use Cases... SWOT of Use Case Diagrams
– User Interface Specifications Objectives
• <Number and Name of UI specifications related with this use case, Strengths
1.Models the Important user as 1.Visualize how system is used
including web-screen specifications>
Actor 2.Scope and Prioritize requirements
– Metrics 2.Organizes Requirements 3.Facilitate project estimation
• <Measurements related to this use case - if relevant to the programme; 3. Facilitates communication 4. Facilitate contract management
Also, perhaps, complexity factor>
4.Documents all Functionality 5. Starting point for other diagrams
– Priority 5. Reuses and extends requirements
• <The importance of the functionality described by this use case High/ 4.Facilitates Traceability of Reqs.
Medium/Low> 5.Provides System Context/
– Status Boundary
• <The state of completeness of the documentation of this use case - Weaknesses Traps
Initial/Major/Final> 1.Not object-oriented 1.Can’t express Non-functional req.
– Author & History 2. Have no documentation standards 2.Ignoring internal use case doc.
• <Original Author and Modifiers of this Use Case> 3.Imprecise Relationships 3. Coding directly from use cases
– Reference Material (arrowhead, stereotype) 4.Pedantic usage, in other
4.Granularity is subjective modellling spaces
• <Relevant reference materials and sources for details>
5. Has no Flow 5. Use case driven project plans
"Copyright Practical OO Analysis, 19 "Copyright Practical OO Analysis, 20
Thomson Publishing, 2005". Thomson Publishing, 2005".
Sub-Module Actor
Inheritance
What is a Use Case Diagram? UML Notation for Use Case Relationships
4
Include Relationship Extend Relationship
• When Requirements tend to Exhibit • Describes extensions to an Existing Use case
Common behaviour, they should be
Factored out • The Extended use case describes one
• These Common Behaviours form a Use case Specialised set of Interactions
of their Own • Enables extending the Use case diagrams for
• They are then “included” in the Original Use new Requirements without disturbing Existing
cases, and many more diagrams
• Tip: Included use case is usually Mandatory; • Tip: Extends implies Specialization of a use case into
However, an If-Then-Else situation can’t be easily
Shown (add Notes) one or more ‘extended’ use cases; Usually its
Optional execution of one of the Extended Use Case;
"Copyright Practical OO Analysis, 25 "Copyright Practical OO Analysis, 26
Thomson Publishing, 2005". Thomson Publishing, 2005".
Inherits Relationship
Sub-Module
• Will make sense when use cases are
documented as ‘essential’ and ‘concrete’
• (Ref. Constantine and Lockwood) Putting Together a
• Essential use cases describe the ‘intentional’ Use Case Diagram
behaviour – corresponding concrete behaviour
can be inherited from it
Visual Representation of
• Tip: This Inherits relationship has still not fully
matured in UML, hence it is best used only when Requirements through Actors, Use
understood within the project cases and Relationships
"Copyright Practical OO Analysis, 27 "Copyright Practical OO Analysis, 28
Thomson Publishing, 2005". Thomson Publishing, 2005".
Note: In this use case diagram, the system boundary has not been drawn. However, observe
'UC36-ManagesConsultationSchedule' How the use cases are all grouped together in the centre of the diagram and the actors are
On the outside. This improves the aesthetics of the use case diagram.
5
Use Case Diagrams: Common
“Accounting” Use Case Diagram Pitfalls!
• Treated as Data Flow Diagrams
Pre-condition is that
the Bill has been Issued
'UC55-PaysBillByCard'
– Use Activity Diagrams to Show the Flow
<<extends>> 'A00-CardReader' • Looks like a Spider’s web
'UC50-PaysBill'
– Abstract both Actors and Use cases and draw
'A10-Patient' <<extends >>
'UC56-PaysBillOnInternet'
separate ‘abstract’ use case diagrams
• Too Coarse or Too Fine Granularity
<<extends >>
'UC57-CashChequePayment'
– Experience needed to Get it Right
'A00-Printer'
– Perhaps Use Case Diagram Patterns can Help?
'A20-PrivatePatient' 'UC58-PlacesInsuranceClaim'
• Use Case Diagrams treated as Deliverables
– More than 50% work is Documenting Use Cases
• Force fitting Actors that Don’t Exist
"Copyright Practical OO Analysis, 31 "Copyright Practical OO Analysis, 32
Thomson Publishing, 2005". Thomson Publishing, 2005".
Workbook Exercises(1)
Workbook 1. Identify and List 5 additional Actors from the hospital domain.
Ensure at least one Actor is a non-human or a device. Stereotype
them appropriately.
2. Place the Actors you identified above in an Actor diagram with
Exercises 3.
appropriate Actor hierarchy. Add notes for clarification.
Document any one of the actors you have identified above. Use the
template provided in the appendix.
4. Identify and document TWO use cases: one in the shorter version
and another in greater detail using the longer and more formal
For The Class Room!! version of use case documentation. Use the template provided in the
appendix.
6
Workbook Exercises(2)
1. Name and Draw two additional use case diagrams from the Hospital
domain. Include at least two actors (from the previous module’s
Project Work :
Classroom exercises) and three use cases spread over the two
diagrams.
(During Tutorials in the Lab);
2. In the first use case diagram, show the include relationship between
two use cases clearly. In addition, show an actor-to-actor inheritance
relationship. Stereotype the actors use cases where relevant.
3. Ensure you have at least one non-human actor in this first diagram. Follow the Project Work Requirements given at the End of
4. Ensure you have shown the system boundary in this first diagram. the Chapter;
5. In the second use case diagram, show the extend relationship clearly. Discuss Project Work with Team Members and Tutor;
Again stereotype the actors and use cases.
6. Add notes on both diagrams to provide further explanations. Carry Out the Project Work