uml – unified modelling language for effective oo development yves holvoet rational software...

28
UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation (say Eve Olvoot)

Upload: cori-obrien

Post on 22-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

UML – Unified Modelling LanguageFor Effective OO Development

UML – Unified Modelling LanguageFor Effective OO Development

Yves Holvoet

Rational Software Corporation

Yves Holvoet

Rational Software Corporation(say Eve Olvoot)(say Eve Olvoot)

Page 2: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

AgendaAgenda

Modelling Why? Levels of Abstraction 5 Views and 2 dimensions of System

Architecture UML

History 10 diagrams

Summary

Modelling Why? Levels of Abstraction 5 Views and 2 dimensions of System

Architecture UML

History 10 diagrams

Summary

Page 3: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

The Importance of ModelingThe Importance of Modeling

Page 4: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

What Is a Model?What Is a Model? A model is a simplification (abstraction) of reality. A model is a simplification (abstraction) of reality.

Page 5: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

AbstractionAbstraction

Is conceptual and captures the essential characteristics of an entity that distinguish it from all other kinds of entities.

Defines a boundary relative to the perspective of the viewer.

Is conceptual and captures the essential characteristics of an entity that distinguish it from all other kinds of entities.

Defines a boundary relative to the perspective of the viewer.

BankAccount- balance : Money- uniqueId : Id

+ withDraw(amount : Money)

Page 6: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Instance Instance

Is an actual entity instance of the conceptual abstraction.

All instances of a given abstraction share a common structure (data and behavior as described in the Abstraction).

Is an actual entity instance of the conceptual abstraction.

All instances of a given abstraction share a common structure (data and behavior as described in the Abstraction).

yourAccount : BankAccount

myAccount : BankAccount

Page 7: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Levels of AbstractionLevels of Abstraction

ClassClassIs an abstraction forIs an abstraction forIs an abstraction forIs an abstraction for objectobject

Is an instance ofIs an instance ofIs an instance ofIs an instance of

Use CaseUse Caseobjectobject

ScenarioHigh LevelHigh LevelHigh LevelHigh Level

SourceSourceProcessProcess

ProcessorProcessor TypeProcessor TypeProcessor TypeProcessor Type

Low LevelLow LevelLow LevelLow Level

Page 8: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Modeling ProcessModeling Process

BusinessBusinessBusinessBusiness Business Use Cases - ActivitiesBusiness Use Cases - ActivitiesBusiness Use Cases - ActivitiesBusiness Use Cases - Activities

Use CasesUse CasesUse CasesUse Cases ScenariosScenariosScenariosScenarios

ClassesClassesClassesClasses ObjectsObjectsObjectsObjects

SourcesSourcesSourcesSources ProcessesProcessesProcessesProcesses

ProcessorsProcessorsProcessorsProcessors

Modeling ProcessModeling Process

Low LevelLow LevelLow LevelLow Level

High LevelHigh LevelHigh LevelHigh Level

InstanceInstanceInstanceInstanceAbstractionAbstractionAbstractionAbstractionSystemSystemSystemSystem

BusinessBusinessBusinessBusiness Business Use Cases - ActivitiesBusiness Use Cases - ActivitiesBusiness Use Cases - ActivitiesBusiness Use Cases - Activities

Page 9: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

UML 1 + 2 * 2 ViewsUML 1 + 2 * 2 Views

SoftwareSoftwareSoftwareSoftwareClassesClassesClassesClasses ObjectsObjectsObjectsObjects

SourcesSourcesSourcesSources

HardwareHardwareHardwareHardware ProcessorsProcessorsProcessorsProcessors

TasksTasksTasksTasks

ProcessesProcessesProcessesProcesses

ScenariosScenariosScenariosScenarios

Use CasesUse CasesUse CasesUse Cases

PackagesPackagesPackagesPackages

LayersLayersLayersLayers

PackagesPackagesPackagesPackages

LayersLayersLayersLayers SystemsSystemsSystemsSystems

Deployment ViewDeployment ViewDeployment ViewDeployment View

Logical ViewLogical ViewLogical ViewLogical View Use Case ViewUse Case ViewUse Case ViewUse Case View

Process ViewProcess ViewProcess ViewProcess ViewImplementation ViewImplementation ViewImplementation ViewImplementation View

Page 10: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

4 + 1 = 1 + 2 * 2 Views4 + 1 = 1 + 2 * 2 Views

Deployment View

Deployment View

Process ViewProcess View

Implementation View

Implementation View

Logical ViewLogical View

Use Case View

Use Case View

The Use-Case view describes the behavior of the system in term of use-cases and scenarios

The Logical view packages the classes of the system and their relationships

The Implementation view describes the mapping of the logical classes to components of the target environment

The Process view deals with concurrency and synchronization

The Deployment view describes the mapping of the software on the hardware

The Use-Case view describes the behavior of the system in term of use-cases and scenarios

The Logical view packages the classes of the system and their relationships

The Implementation view describes the mapping of the logical classes to components of the target environment

The Process view deals with concurrency and synchronization

The Deployment view describes the mapping of the software on the hardware

Page 11: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Use-Case ViewUse-Case View 3 Main Benefits 3 Main Benefits

ClassClass

ValidationValidation

ClassClass

ValidationValidation

SpecificationSpecificationSpecificationSpecification

DevelopmentDevelopment PlanPlanDevelopmentDevelopment PlanPlan

object instanceof class

link instanceof association

message instance of operation

Abstraction for many scenariosAbstraction for many scenariosAbstraction for many scenariosAbstraction for many scenarios

Page 12: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Use Case View: Main BenefitsUse Case View: Main Benefits

Specification in terms of use cases

Development plan lists iterations assign scenarios to iterations according to their risk levels

Validation of classes the necessary objects for the whole system are collectively all

the objects participating in all scenarios the messages between objects drive class relationships

Specification in terms of use cases

Development plan lists iterations assign scenarios to iterations according to their risk levels

Validation of classes the necessary objects for the whole system are collectively all

the objects participating in all scenarios the messages between objects drive class relationships

Page 13: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Logical ViewLogical View 3 Main Benefits 3 Main Benefits

ObjectObject

ValidationValidation

ObjectObject

ValidationValidation

TerminologyTerminologyTerminologyTerminology

Development TeamsDevelopment TeamsDevelopment TeamsDevelopment Teams

Logical grouping of classesLogical grouping of classes

Strong inner coupling (cohesive classes) Strong inner coupling (cohesive classes)

Weak outer coupling (for reuse, resilience)Weak outer coupling (for reuse, resilience)

Logical grouping of classesLogical grouping of classes

Strong inner coupling (cohesive classes) Strong inner coupling (cohesive classes)

Weak outer coupling (for reuse, resilience)Weak outer coupling (for reuse, resilience)

Page 14: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Logical View: Main BenefitsLogical View: Main Benefits Terminology

it provides vocabulary for common unambiguous understanding of the problem domain

Development Teams they are derived from packages packages are created to minimize the coupling

Validation of objects the objects, links and messages must be in synch with class,

relationships and operations

Terminology it provides vocabulary for common unambiguous

understanding of the problem domain Development Teams

they are derived from packages packages are created to minimize the coupling

Validation of objects the objects, links and messages must be in synch with class,

relationships and operations

Page 15: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

2 Dimensions for Software Architecture2 Dimensions for Software Architecture

Logical packagesform horizontal layerswhere layers can onlyaccess what is belowand not what is above

Scenarios form vertical slices where each slice traverses all layers but only “hits” a small

sub-set of the classes

Rational Unified Process is:Rational Unified Process is:

Architecture Centric

Use Case Driven

Rational Unified Process is:Rational Unified Process is:

Architecture Centric

Use Case Driven

Page 16: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

AgendaAgenda

Modelling Why? Levels of Abstraction 5 Views and 2 dimensions of System

Architecture UML

History 10 diagrams

Summary

Modelling Why? Levels of Abstraction 5 Views and 2 dimensions of System

Architecture UML

History 10 diagrams

Summary

Page 17: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

History of the UMLHistory of the UML

Nov ‘97 UML approved by the OMG

Page 18: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

UML ConceptsUML Concepts The UML may be used to visually model:

The interaction of your application with the outside world• Use Case Diagram

The behavior of your system• Interaction Diagram

The structure of your system• Class Diagram• Package Diagram

The components in your system• Component Diagram• Deployment Diagram

The UML may be used to visually model: The interaction of your application with the outside world

• Use Case Diagram

The behavior of your system• Interaction Diagram

The structure of your system• Class Diagram• Package Diagram

The components in your system• Component Diagram• Deployment Diagram

Page 19: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

10 UML Diagrams10 UML Diagrams

Class DiagramClass Diagram (static part of class) (static part of class)

State-Transition DiagramState-Transition Diagram (behavioral part of class) (behavioral part of class)

Class DiagramClass Diagram (static part of class) (static part of class)

State-Transition DiagramState-Transition Diagram (behavioral part of class) (behavioral part of class)

Component DiagramComponent Diagram (Sources & Processes) (Sources & Processes)Component DiagramComponent Diagram (Sources & Processes) (Sources & Processes)

Deployment DiagramDeployment Diagram (Processors) (Processors)Deployment DiagramDeployment Diagram (Processors) (Processors)

Activity DiagramActivity DiagramActivity DiagramActivity Diagram

Use Case DiagramUse Case DiagramUse Case DiagramUse Case Diagram Interaction DiagramInteraction Diagram (Scenarios) (Scenarios)Interaction DiagramInteraction Diagram (Scenarios) (Scenarios)

Object DiagramObject DiagramObject DiagramObject Diagram

Collaboration DiagramCollaboration DiagramCollaboration DiagramCollaboration Diagram

Sequence DiagramSequence DiagramSequence DiagramSequence Diagram

Page 20: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Student

Registrar

Professor

Register for Courses

Maintain Course Information

Request Course Roster

Billing System

Use Case DiagramUse Case Diagram Use case diagrams are created to visualize the

interaction of your system with the outside world Use case diagrams are created to visualize the

interaction of your system with the outside world

Page 21: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

: Student registration form

registration manager

math 101

1: fill in info

2: submit

3: add course(joe, math 01)

4: add(Joe)5: are you open?

6: add (Joe)

math 101 section 1

Sequence DiagramSequence Diagram A sequence diagram shows step-by-step what has to

happen to accomplish a piece of functionality provided by the system

A sequence diagram shows step-by-step what has to happen to accomplish a piece of functionality provided by the system

Page 22: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

: Registrar

course form : CourseForm

theManager : CurriculumManager

aCourse : Course

1: set course info2: process

3: add course

4: new course

Collaboration DiagramCollaboration Diagram A collaboration diagram displays object interactions

organized around objects and their links to one another A collaboration diagram displays object interactions

organized around objects and their links to one another

Page 23: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Student

Professor

RegistrationUser

CourseOffering

major

4

3..10

0..41

Class DiagramClass Diagram

A class diagram shows the structure of your software A class diagram shows the structure of your software

Page 24: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Vegan

eat(Food)

Vegetarian

eat(Food)

Omnivore

eat(Food)

pre-condition of eat() is:-Food parameter must be a Vegetable

pre-condition of eat() is:-Food parameter must be either a Vegetable or Derived from Animal

No pre-condition at all for eat()

Person

<<deferred>> eat(Food)

Food

2 Main Relationships: Inheritance vs. Association2 Main Relationships: Inheritance vs. Association

Page 25: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Course.dllPeople.dll

Course

User

Register.exeBilling.exeBilling

System

The Physical WorldThe Physical World Component diagrams illustrate the organization and

dependencies among software components Component diagrams illustrate the organization and

dependencies among software components

Page 26: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Deploying the SystemDeploying the System The deployment diagram visualizes the distribution of

components across the enterprise. The deployment diagram visualizes the distribution of

components across the enterprise.

Registration Database

Library

Dorm

Main Building

Page 27: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Click on the desired colorClick on the desired color

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

Helpful tip: Double click the paintbrush tool to applycolor to more than oneobject at a time.

SummarySummary Visual modeling can be used to:

Define business process Communicate Manage complexity Define software architecture Promote reuse

The UML is the standard language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system

Visual modeling can be used to: Define business process Communicate Manage complexity Define software architecture Promote reuse

The UML is the standard language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system

Page 28: UML – Unified Modelling Language For Effective OO Development Yves Holvoet Rational Software Corporation Yves Holvoet Rational Software Corporation (say

Questions?Questions?