Top Banner
Compiled by:Dr. Avi Rosenfeld Based on: http://my.ilstu.edu/~asharm4/432/432.ppt http://www.sts.tu-harburg.de/teaching/ws- 97.98/OOA+D/4-4-Class-Advanced.ps ןןןן ןן"ן ןןןןhttp://www3.interscience.wiley.com:8100/ legacy/college/dennis/0471073229/ppt/ ch15.ppt UML an overview
43

Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt 97.98/OOA+D/4-4-Class-Advanced.ps.

Dec 21, 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: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Compiled by:Dr. Avi RosenfeldBased on:

http://my.ilstu.edu/~asharm4/432/432.ppthttp://www.sts.tu-harburg.de/teaching/ws-97.98/

OOA+D/4-4-Class-Advanced.ps " דיין ר מד חומר

http://www3.interscience.wiley.com:8100/legacy/college/dennis/0471073229/ppt/ch15.ppt

UMLan overview

Page 2: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

UML Topics

1. The general picture

2. Use Cases

3. Class Diagrams

4. Sequence Diagram

5. State Chart Diagram

Page 3: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

General Picture: 4+1 view Use Case view

• Understandability Logical View

• Functionality Process View

• Performance• Scalable• Throughput

Implementation View• Software management

Deployment View • System topology• Delivery• Installation

Page 4: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.
Page 5: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

UML Diagrams

UML includes diagrams for use cases static structures (class and object diagrams) behavior (state-chart, activity, sequence and collaboration

diagrams) implementation (component and deployment diagrams).

For data modeling purposes UML uses class diagrams, to which constraints in a textual language may be added

Page 6: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Diagrams in UML

A Diagram is the graphical presentation of a set of elements, most often rendered as a connected graph of things and relationships. UML includes 9 such diagrams.

1. Class Diagram. V

2. Object Diagram. V

3. Use Case Diagram. V

4. Sequence Diagram. V

5. Collaboration Diagram.

6. State Chart Diagram. V

7. Activity Diagram.

9. Deployment Diagram.

Page 7: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Class Diagrams

Class Diagrams describe the static structure of a system, or how it is structured rather than how it behaves. These diagrams contain the following elements.

• Classes, which represent entities with common characteristics or features. These features include attributes, operations and associations.

• Associations, which represent relationships that relate two or more other classes where the relationships have common characteristics or features. These attributes and operations.

Page 8: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Class Diagram

Skill

Name: String

Desc: String

Create(): Skill

setName(): (Name:String)

getName(): String

setDesc(): (Desc:String)

getDesc(): String

destroy()

Page 9: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 9

An Object and Object Instances

Page 10: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 10

Classes and Objects

Page 11: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 11

Class Hierarchy

Page 12: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Object Diagrams

Object Diagrams describe the static structure of a system at a particular time. Whereas a class model describes all possible situations, an object model describes a particular situation. Object diagrams contain the following elements:

• Objects, which represent particular entities. These are instances of classes.

• Links, which represent particular relationships between objects. These are instances of associations.

.

Page 13: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

של דוגמאכספומט

Page 14: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 14

Class Diagram for Manage Appointment

Page 15: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

טרמינולוגיה של יחס Associationיחס בשם

ממודל בעזרת קו המקשר שתי מחלקות. Associationהיחס .Executes, יש גם כיוון: ראה את השם association. כאשר נותנים שם ל-associationאפשר לתת שם ל-

. role nameאפשר גם לציין תפקיד דוגמא

אובייקטים בין תלות

Page 16: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

יחס יש סוגים Multiplicityמושג

ערכים שמופיעים בקצוות הקו המקשר שתי מחלקות. .associationכל ערך אומר כמה אובייקטים מכל מחלקה משתתפים ב-

Page 17: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 17

Multiplicity

Page 18: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Composition

Aggregationיחס בשם )יהלום חלול(.hollow diamond יחס זה הוא יחס חלש. הוא ממודל בעזרת

רשימת היחסים One-to-One relationshipהיחס

One-to-Many relationshipהיחס Many-to-One relationshipהיחס

Page 19: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Aggregation

Page 20: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 20

Aggregation and Generalization Associations

Page 21: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Composition

Page 22: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Use Case Diagrams

Use Case Diagrams describe the functionality of a system and users of the system. These diagrams contain the following elements:

• Actors, which represent users of a system, including human users and other systems.

• Use Cases, which represent functionality or services provided by a system to users.

Use case diagrams

Page 23: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

High Level Use Case Diagram

Manage Resources

Manage Projects

System Admin

Resource Manager

Project Manager

System Administrator

Page 24: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Managing Resources Use Case DiagramAdd Skill

Remove Skill

Update Skill

Find Skill

Add Resourc

eRemove Resourc

eUpdate Resourc

e

Find Resourc

e

Unassign Skill from

Resource

Assign Skill from

Resource

Resource Manager

Page 25: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Actors

Page 26: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 26

Use Case

Page 27: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 27

Use-Case Diagram for Specialized Actor

Page 28: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 28

Extends or Uses Associations

Page 29: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 29

Steps in Creating the Use Case Diagram

1. Identify use cases2. Draw the system boundary3. Place use cases on the diagram Group use cases into packages

Add special use case associations

4. Identify the actors5. Add associations

Page 30: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Sequence Diagrams

Sequence Diagrams describe interactions among classes. These interactions are modeled as exchange of messages. These diagrams focus on classes and the messages they exchange to accomplish some desired behavior. Sequence diagrams are a type of interaction diagrams. Sequence diagrams contain the following elements:

• Class roles, which represent roles that objects may play within the interaction.

• Lifelines, which represent the existence of an object over a period of time.

• Activations, which represent the time during which an object is performing an operation.

• Messages, which represent communication between objects.

Page 31: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Sequence Diagram

Page 32: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 32

Sequence Diagram

Page 33: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 33

Steps in Creating a Sequence Diagram

1. Identify classes2. Add actions3. Place lifeline and focus of control

Page 34: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 34

Syntax for Sequence Diagram

Page 35: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

Statechart Diagrams

Statechart (or state) diagrams describe the states and responses of a class. Statechart diagrams describe the behavior of a class in response to external stimuli. These diagrams contain the following elements:

• States, which represent the situations during the life of an object in which it satisfies some condition, performs some activity, or waits for some occurrence.

• Transitions, which represent relationships between the different states of an object.

Page 36: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 36

Sequence Diagram

Page 37: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

State Chart Diagram

Page 38: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 38

Statechart Concepts A dynamic model showing changes

of state of a single class over time in response to events along with its responses and actions

Typically not used for all classes, but just to help simplify the design of algorithms for methods of complex classes

Page 39: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 39

Statechart Diagram for a Hospital Patient

Page 40: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 40

Syntax for Statechart Diagram

Page 41: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 41

The Life of an Order

Page 42: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 42

Steps for Creating a Statechart Diagram

1. Identify the states2. Identify the transitions

Page 43: Compiled by:Dr. Avi Rosenfeld Based on: asharm4/432/432.ppt  97.98/OOA+D/4-4-Class-Advanced.ps.

PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2nd EditionCopyright 2003 © John Wiley & Sons, Inc. All rights reserved.

15 - 43

Statechart Diagram for an Order