Download presentation
Presentation is loading. Please wait.
1
Sequence Diagrams
2
Analysis Paralysis “Do you want it perfect or do you want it now?”
3
Watch out for Red Herrings
4
Faulty Assumptions In the second lecture we drew up the following detailed specification… The consultant sits at their desk with a stack of business cards and flyers. They pick up a business card and start to input the details into system. The first field they enter is the name of the company. While doing this the system looks up the company name to see if it is already on the system. The next field the user enters is the name of the contact. Whilst dong this, the list of contacts for that company is displayed such that if the contact is already on the system the user may move onto another business card. At this point the user should have the opportunity to update the details on the system should they note that some aspect has change e.g. address.
5
From this we drew up an initial event table…
Subject Verb Object Response Consultant Inputs Card Data accepted by the system System Checks Identifying duplicates Updates New data input
6
Resulting in the following initial use case diagram…
7
There is a problem Back to that red herring
If we collected business cards like stamps then yes we would be interested in recording individual cards What’s more important in our case isn’t the cards but the data they contain We are interested in business intelligence on the companies and the people they employ This new insight means we need to re-visit all the other associated documentation!
8
We Need to Revise the Specification
The consultant sits at their desk with a stack of business cards and flyers. They pick up a business card and start to input the details into system. The user is interested in recording details of the individual and associated company. The first field they enter is the name of the company. While doing this the system looks up the company name to see if it is already on the system. The next field the user enters is the name of the contact. Whilst dong this, the list of contacts for that company is displayed such that if the contact is already on the system the user may move onto another business card. At this point the user should have the opportunity to update the details on the system should they note that some aspect has change e.g. address.
9
And the Event Table Subject Verb Object Response Consultant Inputs
Company Name System produces a list of companies with that name System Finds Company Produces a list of companies with that name Lists Employees Produces a list of employees at each company Adds Company added to the system Employee Employee added to the system Updates Employee details updated Company details updated
10
And the Use Case Diagram
11
And Probably the Class Diagram
12
The Sequence Diagram Allows us to cross check our use cases and classes The smoke and mirrors prototype informs this process Need to think in terms of what classes support our use cases…
13
Triangulation Not a simple linear process
Class Designs Use Cases Sequence Diagram Not a simple linear process Things we discover later shed light on what we thought we knew previously
14
First go at the Sequence Diagram
Actors Objects Life lines Messages
15
Important Questions to Ask
Do we have an actor on the use case that matches the sequence diagram?
16
Important Questions to Ask
Do we have a classes that map to those on the sequence diagram?
17
Important Questions to Ask
Do we have operations in the classes that are able to handle the messages? FilterByCompanyName FilterByCompanyNo
18
Revise the Class Diagram
19
So What Data Comes Back? We may also find clues to the attributes (CompanyName / CompanyNo)
20
Extending the Sequence Diagram
Can we return list data from one life line to another? Do we have an operation to support this message?
21
Revise the Class Diagram
22
What About Validation?
23
Modify the Use Case Diagram
24
Where to Place the Validation Method?
Composition and Aggregation Revisited Composition Aggregation Order Order Line Has 1 0..* Attributes Operations Customer Address Uses 1 1..* Attributes Operations
25
Does this Make sense? Aggregation or Composition?
26
This is an Aggregation This will need extending to include the parameters
27
The Sequence Diagram
28
The Use Case Diagram
29
The Class Diagram
30
Is it right? Probably not yet
But we now have a mechanism to cross check one diagram with another
31
Exercise Start with an interface component e.g. adding a new record
Plan out the interface on paper Think about what classes would be required to make this interface work Have a go at drawing out an initial sequence diagram Check the triangulation between your use cases and your classes What use cases / classes might be required
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.