Top Banner
Lecture 12: Chapter 22 Topics: UML (Contd.) – Relationship • Structural • Behavioral – Diagram • Structural • Behavioral
32

Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Lecture 12: Chapter 22

Topics: UML (Contd.)– Relationship

• Structural• Behavioral

– Diagram• Structural• Behavioral

Page 2: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship

• Structure Relationship– Describes the ways things are in

relation to one another– Shows relationship between classes

• Behavioral Relationship– Primarily used in use cases diagrams

Page 3: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Structural

Page 4: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Structural: Dependency (uses)

• Used to show the relationship when one thing somehow affects another

• Such relationship is described as “uses” or “used by”

• Example:– A vehicle uses fuel

Page 5: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Structural: Aggregation (has a)

• Aggregation shows that an object is composed of he sum of other objects

• Example: • A rental contract has a customer• A rental contract has a car

Relationship: Structural

Page 6: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Structural: Association

• Describes connection between things

• May show multiplicity in associating different things

• Example: • A customer has signed a rental contract

Relationship: Structural

Page 7: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Structural: Generalization (is a)

• Describes the relationship between general things and more specialized things

• Example: • Car/track is more specialized thing of

general thing vehicle

Relationship: Structural

Page 8: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Behavioral

• Primarily used in use case diagram• Type:

–Communicates–Includes–Extends–Generalizes

Page 9: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Behavioral: Communicates

• Used to connect an actor to a use case

Customer

Rent Vehicle

Page 10: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Behavioral: Includes

• Describes the situation where a use case contains behavior that is common to more than one use case

Rent Vehicle

Verify Credit Card

Check Driver'sLicense

«include»

«include»

Page 11: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Behavioral: Extends

• Used when a use case extends the behavior of another use case

Rent VehicleArrange for AddedInsurance «extend»

Page 12: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Relationship: Behavioral: Generalizes

• Shows general thing of a specialized thing in a use case

Gold Card Customer Customer

Page 13: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural

• Structural Diagram includes:– Class Diagram– Object Diagram– Component Diagram– Deployment Diagram

Page 14: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Class Diagram

• Used to view the structural design to meet the functional requirement of the system

• Don’t reflect the state of the system at a particular moment

Page 15: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Class Diagram (Contd.)

Page 16: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Object Diagram

• Describes the state of class instances and their relationship at a point in time

Page 17: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Object Diagram (Contd.)

Page 18: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Component Diagram

• Shows the components of the system and how they are related to each other

• Each component is analyzed in more detail using class diagrams and use case diagrams

Page 19: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Component Diagram (Contd.)

eCommerce System

Order Processing System

POS System

Warehouse System

External Systems

dependency

Package

Page 20: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Deployment Diagram

• Shows the Physical implementation of the system, including hardware

Page 21: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Structural: Deployment Diagram (Contd.)

POS Client

Bar Code Reader

Credit Card Reader

Web ServerClient Browser

Corp. Application Server

Corp. Database Server

POS Server

Internet<<network>>

WAN<<network>>

0..n internet clients

0..n StoresOrder Clerk Workstation 0..n Telesales clerk

workstations

Warehouse Server

Receipt Printer

0..n clients per store

Page 22: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral

• Structural Diagram includes:– Use Case Diagram– Sequence Diagram– Collaboration Diagram– State Diagram– Activity Diagram

Page 23: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Use Case Diagram

• Shows the actors and use cases within the the framework of the system

Page 24: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Use Case Diagram (Contd.)

Store Manager

Add New User

Remove User

Edit User Information

POS LoginUser Maintenance

<<extend>><<extend>>

<<extend>>

<<include>>

User Management Use Cases

Page 25: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Sequence Diagram

• Shows the interaction between objects over time

• Illustrates the process describes in use case scenario

Page 26: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Sequence Diagram (Contd.)

Page 27: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Collaboration Diagram

• It does not focus on sequence of interactions over time like sequence diagram

• Instead it focuses on the organization of objects during the interaction

Page 28: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Collaboration Diagram (Contd.)

Person::Rental Agent Person::Customer

::Vehicle

::Staff

agent 1

car from fleet rent car *

driver *

customer *rental agent *

staff 1

employees *

Page 29: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: State Diagram

• Shows various states of an object

• Shows the events and conditions that trigger a transition from one state to another

Page 30: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: State Diagram (Contd.)

Page 31: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Activity Diagram

• Show the flow of activities within a process

• Focuses on state and state transition instead on sequence of activities over time

• Shows transition between states and the flow of control within a process

Page 32: Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.

Diagram: Behavioral: Activity Diagram (Contd.)