1 / 18

Week 10

Week 10. State diagrams Activity Diagrams Summary and Conclusion / The Future Critique discussion Lab 4 is marked. Remaining UML Diagrams. State diagram Activity diagram. States of an Object. Objects do not always react the same way to the same message (method call)

shiro
Download Presentation

Week 10

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week 10 • State diagrams • Activity Diagrams • Summary and Conclusion / The Future • Critique discussion • Lab 4 is marked Kate Gregory

  2. Remaining UML Diagrams • State diagram • Activity diagram Kate Gregory

  3. States of an Object • Objects do not always react the same way to the same message (method call) • Withdraw $100: will it succeed? Always? • It depends what state it is in: overdrawn, on hold, normal, … • Some objects have states worth studying Kate Gregory

  4. State Diagram • Bank Account: Kate Gregory

  5. When to draw a State Diagram • Not always and not for every object • If you have rules that depend on the state • Shipping fees can’t be calculated until order is approved • Accounts can’t be closed if there are outstanding service charges • If you have “side effects” of state transitions • Eg email alerts • Can be a compact and powerful way to direct a programmer • One of the few diagrams I update throughout the life of a project

  6. How do you do it? • Identify a class that has interesting states • Give the states names • Usually adjectives • Pending/approved/archived/completed • Look at the existing methods to see which ones change the state • Look at the existing methods to see which ones depend on the state Kate Gregory

  7. Notes become diagram • In what state is the object created? • In that state, what methods can be called? • And do they change the state or keep it the same? • Does it depend on some other value? • Are there side effects (eg send email?) • Continue until all the states are drawn • From what states can the object be destroyed?

  8. Lab 5 • Should you add a state diagram? • What class or classes have interesting states? • What rules can you convey efficiently using a state diagram? • Re read the use cases Kate Gregory

  9. Activity Diagram • Describes a sequence of activities (often a use case) • Illustrates the business process • Helpful when there are a lot of diversions and a lot of way to reach the same final situation • Clarifies order (as a sequence diagram does) but is not concerned with what objects and methods get the job done Kate Gregory

  10. Morning Activity Diagram Kate Gregory

  11. Lab 5 • Should you add an activity diagram? • Re read the use cases – are there parallel activities? • Is it necessary to co-ordinate activities at all? Kate Gregory

  12. Requirements Use cases Use case diagrams Finding objects and their insides Candidate class lists CRC cards Collaboration diagrams Encapsulation, good and bad Where have we been? Kate Gregory

  13. Class diagram Classes Attributes Object is not attribute Objects have identity Methods Parameters and types Relationships Association Aggregation Composition Inheritance polymorphism Where have we been? Kate Gregory

  14. Where have we been? • Sequence / Interaction diagrams • Design patterns • Metrics • SOLID principles, RAII • Modules and packages • Deployment and component diagrams • State diagrams • Activity diagrams Kate Gregory

  15. Next Week • Make sure you are signed up for a slot • Critiques start at 9 am – please be here! • No written submissions accepted after first presentation starts • Enter QUIETLY and respectfully • Come at start of class no matter when your presentation is, and stay for the whole thing Kate Gregory

More Related