1 / 21

UML

UML. Overview. UML Diagrams to be Covered. Class Diagrams Use Case Diagrams Collaboration Diagrams Sequence Diagrams Package Diagrams Component Diagrams Deployment Diagrams Activity Diagrams State Diagrams. Class Diagrams. Are the most fundamental UML Diagram.

osborn
Télécharger la présentation

UML

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. UML Overview

  2. UML Diagrams to be Covered • Class Diagrams • Use Case Diagrams • Collaboration Diagrams • Sequence Diagrams • Package Diagrams • Component Diagrams • Deployment Diagrams • Activity Diagrams • State Diagrams

  3. Class Diagrams • Are the most fundamental UML Diagram. • Describe the classes in the system, and the static relationships between classes. • Class diagrams are used during Analysis, Design and Development.

  4. UML Class Diagram Customer 1 Rental Invoice 1..* Rental Item {abstract} 1 0..1 1 Checkout Screen DVD Movie VHS Movie Video Game

  5. UML Class Diagram Multiplicity Customer Simple Aggregation 1 Class Abstract Class Rental Invoice 1..* Rental Item {abstract} 1 0..1 Composition (Dependency) Simple Association Generalization Checkout Screen DVD Movie VHS Movie Video Game

  6. MyClassName +SomePublicAttribute : SomeType -SomePrivateAttribute : SomeType #SomeProtectedAttribute : SomeType +ClassMethodOne() +ClassMethodTwo() Responsibilities -- can optionally be described here. Parts of a Class • Classes can have four parts • Name • Attributes • Operations • Responsibilities • Classes can show visibility and types. • All parts but the Name are optional.

  7. ThisOne : MyClassName +SomePublicAttribute : SomeType -SomePrivateAttribute : SomeType #SomeProtectedAttribute : SomeType +ClassMethodOne() +ClassMethodTwo() Object Diagrams • An Object is an instance of a class. • Object names are underlined. • Object diagrams are similar to class diagrams. Many of the same notations are used. • Object diagrams capture instances of classes, and allow the dynamic relationships to be shown.

  8. Class and Object Diagrams Class Name Association Name Customer Rental Item Rents +id:integer +id:integer 0..n +name:string +released:date 0..1 Class Diagram Attributes Object Name Joe: Customer Casablanca: Movie +id:1667 +id:22340 +name:Joe Smith +released:1942 Object Diagram

  9. Stereotypes, Tagged Values and Constraints extend the UML Stereotypes are shown using <<>> Tagged Values and Constraints are shown using { } Stereotypes, Tagged Values and Constraints Tagged Value Stereotype RentalContract <<persistent>> {version=1.1} ListOfRentedItems Customer {ordered by title} Constraint

  10. Use Cases • Describe interactions between users and computer systems (both called actors) . • Capture user-visible functions. • Achieve discrete measurable goals. • Are typically used during Analysis and Design.

  11. Use Case Actor Identify Movie Open Account Customer Clerk Return Movie Review In-Store Telephone Account Status Customer Customer Use Case Diagram

  12. Collaboration Diagrams • Collaboration diagrams describe object interactions organized around the objects and their links to each other • Focus on exchange of messages between objects through their associations. • Appears during Analysis phase • Enhanced during Design phase

  13. Collaboration Diagram - Rent Movie Object :Rented Items 5: add(customer, movies) 1: enter_customer() 8: generateRentalTotal() 3: enter_movies() 2: IsValidCust(CustId) 7: print invoice() :Check-out Manager :Customer :Clerk 4:GetMovieByBarcode() Message :Inventory

  14. Sequence Diagrams • Describe interactions between objects arranged in time sequence • Focus on objects and classes involved in the scenario and the sequence of messages exchanged • Associated with use cases • Used heavily during Analysis phase and are enhanced and refined during Design phase

  15. Sequence Diagram - Rent Movie :CheckoutMgr Cust:Customer :Inventory :RentedItems :Employee 1: find customer() 2: search (string) Object 3: enter movie() 4: search (string) Activation Message 5: rent (movie) 6: add(Cust, item) Lifeline 7: printInvoice() 8: generateRentalTotal()

  16. Package Diagram Class Package

  17. Component Diagram Component Interface Dependency Note

  18. Deployment Diagram Node Communication Association

  19. Activity Diagram Start State Identify Caller Action State Obtain Name & Address Decision Open Account? Current Customer? [no] [no] [yes] [yes] End State Create Account

  20. Swimlanes and Fork/Join Points Customer Manager Walking Clerk Identify Movie Fork Point Place Order Place Order Fill Order Pay Collect Money Pickup Movie Deliver Movie Join Point

  21. State Diagram Guard Event Transition Action Activity State

More Related