310 likes | 342 Views
Sequence Diagrams. Analysis Paralysis. “Do you want it perfect or do you want it now?”. Watch out for Red Herrings. Faulty Assumptions. In the second lecture we drew up the following detailed specification…
E N D
Analysis Paralysis • “Do you want it perfect or do you want it now?”
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. email address.
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!
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. email address.
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…
Triangulation Class Designs • Not a simple linear process • Things we discover later shed light on what we thought we knew previously Use Cases Sequence Diagram
First go at the Sequence Diagram • Actors • Objects • Life lines • Messages
Important Questions to Ask • Do we have an actor on the use case that matches the sequence diagram?
Important Questions to Ask • Do we have a classes that map to those on the sequence diagram?
Important Questions to Ask • Do we have operations in the classes that are able to handle the messages? • FilterByCompanyName • FilterByCompanyNo
So What Data Comes Back? • We may also find clues to the attributes (CompanyName / CompanyNo)
Extending the Sequence Diagram • Can we return list data from one life line to another? • Do we have an operation to support this message?
1 1 Has Uses 0..* 1..* Order Order Line Customer Address Attributes Attributes Attributes Attributes Operations Operations Operations Operations Where to Place the Validation Method? • Composition and Aggregation Revisited • Composition • Aggregation
Does this Make sense? • Aggregation or Composition?
This is an Aggregation • This will need extending to include the parameters
Is it right? • Probably not yet • But we now have a mechanism to cross check one diagram with another
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