lecture 12: chapter 22 topics: uml (contd.) –relationship structural behavioral –diagram...

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

Post on 19-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

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

Relationship: Structural

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

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

Relationship: Structural: Association

• Describes connection between things

• May show multiplicity in associating different things

• Example: • A customer has signed a rental contract

Relationship: Structural

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

Relationship: Behavioral

• Primarily used in use case diagram• Type:

–Communicates–Includes–Extends–Generalizes

Relationship: Behavioral: Communicates

• Used to connect an actor to a use case

Customer

Rent Vehicle

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»

Relationship: Behavioral: Extends

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

Rent VehicleArrange for AddedInsurance «extend»

Relationship: Behavioral: Generalizes

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

Gold Card Customer Customer

Diagram: Structural

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

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

Diagram: Structural: Class Diagram (Contd.)

Diagram: Structural: Object Diagram

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

Diagram: Structural: Object Diagram (Contd.)

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

Diagram: Structural: Component Diagram (Contd.)

eCommerce System

Order Processing System

POS System

Warehouse System

External Systems

dependency

Package

Diagram: Structural: Deployment Diagram

• Shows the Physical implementation of the system, including hardware

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

Diagram: Behavioral

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

Diagram: Behavioral: Use Case Diagram

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

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

Diagram: Behavioral: Sequence Diagram

• Shows the interaction between objects over time

• Illustrates the process describes in use case scenario

Diagram: Behavioral: Sequence Diagram (Contd.)

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

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 *

Diagram: Behavioral: State Diagram

• Shows various states of an object

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

Diagram: Behavioral: State Diagram (Contd.)

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

Diagram: Behavioral: Activity Diagram (Contd.)