uml diagrams
play

UML Diagrams Tuesday, October 30 1 Announcements Sprint 3 - PowerPoint PPT Presentation

UML Diagrams Tuesday, October 30 1 Announcements Sprint 3 overview 2 Software Diagramming Useful when you need to communicate, visualize, analyze something, especially something with some structure 3


  1. UML Diagrams Tuesday, October 30 1

  2. Announcements Sprint 3 overview 2

  3. Software Diagramming Useful when you need to communicate, visualize, analyze something, especially something with some structure 3

  4. https://en.wikipedia.org/wiki/Gray%27s_Anatomy#/media/File:Gray219.png 4

  5. http://www.instructables.com/file/F7847TEFW4JU1UC/

  6. 6

  7. 7

  8. Unified Modeling Language (UML) A set of many visual modeling techniques … 9

  9. UML – what is it good for? Forces you to stop and think about design Get a high-level picture of the design, better understand, find problems Communication tool Vocabulary Teaching tool Marian Petre: ML in practice. ICSE 2013: 722-731 11

  10. Some UML diagrams Activity Diagram Object Diagram Class Diagram Package Diagram Communication Diagram Sequence Diagram Component Diagram State Machine Composite Structure Diagram Diagram Timing Diagram Deployment Diagram Interaction Overview Use Case Diagram Diagram http://www.agilemodeling.com/ 12 essays/umlDiagrams.htm

  11. Classes of UML diagrams Behavior Depicts the behavioral features of the system or process Activity, sequence, state machine diagrams Structure Depicts the elements of a specification irrespective of time Class diagram 13

  12. Activity Diagram Used to model business process, or a single usage scenario, or a business rule Example: Online Shopping Purchasing Ticket from vending machine Reserving a Flight 14

  13. Activity Diagram Graphical representations of activities or workflow Different shapes have different meanings Flow goes from start to the end 15

  14. Activity Diagram Parts Black circle represents the start Rounded rectangle represents actions Diamonds represent decisions Black Bars represent concurrent activities Optional: Partition diagram with lines 16

  15. initial node action decision flow/edge fork activity end join

  16. Exercise Buy the "UML Distilled" text book from amazon.com 18

  17. Sequence Diagram A Sequence Diagram is an interaction diagram that shows how processes operate with one another and in what order They typically model usage scenarios, logic of methods, the logic of services Helpful for understanding asynchronous code Examples Submitting comments on a website Facebook user authentication 19

  18. Sequence Diagram Parts Each actor is represented as a labeled vertical line Each message is a horizontal line, with message name written above line Open arrow heads represent async messages Dashed lines are responses 20

  19. Sequence Diagrams actor msg name Computer Server checkEmail sendUnsentEmail Lifeline getNewEmail message response [newEmail] downloadEmail Focus of Control/ deleteOldEmail Activation https://en.wikipedia.org/wiki/Sequence_diagram 21

  20. Exercise Buy the "UML Distilled" text book from amazon.com 22

  21. UML State Diagram A state diagram shows the states of an object. Similar to a other State Diagrams, e.g. State Machine Examples: State of phone line Elevator movement 23

  22. State Diagram Parts Name Normal State Activities Start/Initial State Stop/Accepting/Final State Transition EventName [Guard] / Action 24

  23. Report Status Raw (just test) record geocoding fails & user retweets Geocoded in database (geocode != null) (geocode == null) geocoding succeeds 25

  24. Actions vs. Activities Actions are associated with transitions, are considered to be processes that occur quickly and are not interruptible Activities are associated with states , can take longer, and can be interrupted by events “do” events can iterate “entry” events happen only on entry to state 26

  25. Use Case Diagrams Use Case Diagram at its simplest is a representation of a user’s interaction with a system. Use Cases similar to User Stories, but more formal and more complex 27

  26. Use Case Include: Summary of usage requirements, from users point of view Basic Course of Events Alternative Paths Preconditions / Postconditions 28

  27. Obtain Student Loan Pay Fees Financial Institution Student Enroll in class Drop Class Registrar http://agilemodeling.com/artifacts/ useCaseDiagram.htm

  28. Class Diagrams 30

  29. Object Terminology An object mirrors real world entity Examples: Person, student, book, card, game, etc. 31

  30. Object Terminology Objects Contain (class): attributes (variables) functionality (methods) Objects can have properties or be acted upon 32

  31. Encapsulation Objects allow data and functionality to be bundled together. Additionally, access to the data may be restricted to some of the objects components 33

  32. Polymorphism The ability to send the same message (call a method) to an Object, without knowing how the receiver (Object) will implement the message. 34

  33. Building an Object Oriented Model Our model should: represent entities show connections and interactions show enough detail to evaluate designs 35

  34. Example class: employee: has a name, employee#, department an employee is hired, fired; an employee works in one or more projects 36

  35. Name Attributes Operations

  36. UML Class Diagram parts Objects do not exist in isolation UML supports: Association Aggregation and Composition Generalization Dependency 38

  37. Class Associations Most generic kind of relationship :Employee :Office name room #: employee# # of desks: 0..* Works in 1 department hire() add_Employee() fire() remove_Employee() assignProject() 39

  38. Example of an association class :car :person VIN name 0..* Year Made address owns 1 Mileage DriversLicenseNumber … … :title yearBought price initialMileage … 40

  39. Aggregation and Composition Aggregation: This is the “has-a” or “whole/part” relationship Composition: implies ownership 41

  40. Aggregation and Composition example 1 :engine Composition 1 :car 0..1 :person 1 driver Aggregation 42

  41. Generalization example 43

  42. 44

  43. Exercise Book buying in Amazon Specific book versions may have differences (online, hard copy, soft copy) Books are written by authors Books have reviews A user (or their account) 45

  44. http://www.uml-diagrams.org/class-diagrams- overview.html

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend