Introduction to UML Todd Bacastow Rational Unified Process
Introduction to UML Todd Bacastow
Rational Unified Process A process for the effective implementation of key “Best Practices” Manage Requirements Develop Iteratively Model Visually Verify Quality Control Changes Use Component Architectures
Features of the Process • Attack risks through progress measured in products - not documentation • Continuous integration • Frequent releases • Continuous user involvement
RUP is an Iterative Approach Requirements Capture Analysis & Design Planning Implementation Initial Planning Management Environment Deployment Evaluation Test
Manage Requirements • Elicit, organize, and document required functionality and constraints • Track and document tradeoffs and decisions • Business requirements are captured and communicated through use cases • Use cases are important planning instruments Use-Case Model realization influenced by verifies Design Model Implementation Model Test Model
Model Visually • Capture the structure and behavior of architectures and components • Show the elements of the system fit together • Maintain consistency between a design and its implementation • Promote unambiguous communication Sub Systems Classes Code
What is the UML? • Unified Modeling Language • It is a modeling language, not a process • In 1996, work on the UML was begun by Rational.
UML Diagrams 1. 2. 3. 4. 5. 6. 7. 8. 9. Class (and Object) Diagrams Use Case Diagrams Collaboration Diagrams Sequence Diagrams Package Diagrams Component Diagrams Deployment Diagrams Activity Diagrams State Diagrams
Class Diagrams • Offspring of the Entity-Relationship Diagram • 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
UML Class Diagram Customer 1 1. . * Rental Item 1. . * Rental Invoice 1 0. . 1 1 DVD Movie VHS Movie Video Game Checkout Screen
UML Class Diagram Multiplicity Customer Class Simple 1 Aggregation Abstract Rental Invoice 1. . * Class Rental Item {abstract} 1. . * 1 0. . 1 Composition DVD Movie Simple (Dependency) Generalization 1 VHS Movie Video Game Checkout Screen Association
Associations, Aggregations, and Generalizations • Association - describe the relationships between classes or objects • Aggregation - each invoice is composed of one customer and one or more customers can be part of an invoice • Composition – an invoice cannot exist without component rental items • Generalization – DVD, VHS, and game are fully consistent with Rentable Item and may be used wherever Rentable Item is allowed
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 • Think of it as a table My. Class. Name +Some. Public. Attribute : Some. Type -Some. Private. Attribute : Some. Type #Some. Protected. Attribute : Some. Type +Class. Method. One() +Class. Method. Two() Responsibilities -- can optionally be described here.
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 • Think of it as a row in a table This. One : My. Class. Name +Some. Public. Attribute : Some. Type -Some. Private. Attribute : Some. Type #Some. Protected. Attribute : Some. Type +Class. Method. One() +Class. Method. Two()
Class and Object Diagrams Association Name Class Name Customer +id: integer +name: string Rental Item Rents 0. . 1 0. . * +id: integer +released: date Class Diagram Attributes Object Name Joe: Customer Casablanca: Movie +id: 1667 +name: Joe Smith +id: 22340 +released: 1942 Object Diagram
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.
Use Case Diagram Use Case Actor Identify Movie Customer Open Account Return Movie In-Store Customer Telephone Customer Review Account Status Clerk
Use Case Report • The Use Case Report provides documentation for the Use Case. • A Use Case is not complete without the report. • The elements of the Use Case Report are shown on the right. • Brief description • Precondition • Flow of events – Main flow – Subflows – Alternate flows • Postcondition • Special Requirements • Enclosures – Diagrams – Pictures of the UI
UML Diagram Usage
Summary • UML is a standardized notation that can express information gathered throughout a project’s lifecycle. • UML can improve communication between clients and developers. • UML can be used as an effective data modeling tool as well as an object modeling tool.
- Slides: 20