ARCH-2: UML 101 - From Design to Implementation using UML
description
Transcript of ARCH-2: UML 101 - From Design to Implementation using UML
ARCH-2: UML 101 - From Design to Implementation using UML
Frank Beusenberg Senior Technical Consultant
© 2006 Progress Software Corporation2ARCH-2: UML 101 - From Design to Implementation using UML
Theory vs. Practice
The difference between The difference between theory and practice is that, in theory and practice is that, in theory, there is no difference theory, there is no difference between theory and practice.between theory and practice.
© 2006 Progress Software Corporation3ARCH-2: UML 101 - From Design to Implementation using UML
Shu-Ha-Ri
ShuShu - Learning- LearningHaHa - Understanding- UnderstandingRiRi - Be creative- Be creative
© 2006 Progress Software Corporation4ARCH-2: UML 101 - From Design to Implementation using UML
Agenda
Introduction UML 2.0 Diagrams Use Case View Logical View Dynamic View Implementation View Demonstration Q&A
© 2006 Progress Software Corporation5ARCH-2: UML 101 - From Design to Implementation using UML
UML = Unified Modeling Language First UML spec in 1997 Current version = 2.0
• Object Management Group (OMG) Graphical language
• Object Oriented in nature• Has syntax rules• Can be extended using stereotypes
NOT a methodology!
Introduction
What is UML? Facts
© 2006 Progress Software Corporation6ARCH-2: UML 101 - From Design to Implementation using UML
Introduction
What is UML?
© 2006 Progress Software Corporation7ARCH-2: UML 101 - From Design to Implementation using UML
Manage complexity Mitigate risk Facilitate communication
Modeling provides ability to visualize entire systems, assess options and designs• Software has grown from do-it-yourself into highly
complex systems• Software is integral part of business process, so has to
be well planned• Software has become capital equipment that cannot
just be removed/changed
Introduction
Why model?
© 2006 Progress Software Corporation8ARCH-2: UML 101 - From Design to Implementation using UML
Specify, visualize, and document models of software systems• Current and new systems
• Structure and design
• Behavior and interaction
De facto standard (Tool Support!) Unambiguous and consistent notation Documentation
Introduction
Why use UML?
© 2006 Progress Software Corporation9ARCH-2: UML 101 - From Design to Implementation using UML
Agenda
Introduction UML 2.0 Diagrams Use Case View Logical View Dynamic View Implementation View Demonstration Q&A
© 2006 Progress Software Corporation10ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Diagrams
UML 2.0 Types of Diagrams – Behavior Diagrams
© 2006 Progress Software Corporation11ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Behavioral Diagrams
Describes the functional requirements of the system
UML Use Case Diagram
© 2006 Progress Software Corporation12ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Behavioral Diagrams
Describe procedural logic, business processes and workflow
UML Activity Diagram
© 2006 Progress Software Corporation13ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Behavioral Diagrams
Describes the message flow between objects in chronological order
UML Sequence Diagram
sd Serv ice Manager - Component Creation
«interface»
Interfaces::IServiceManager
Component::Component«interface»
Interfaces::ISecurityManager
System
(from Actors)
«interface»
Interfaces::IComponentFactory
alt Component Started
[No]
alt Authorized
[TRUE]
Reference= startService(logicalName,componentType)
Authorized= isAuthorized()
Reference= Check Local Cache for Component
Reference= createInstance(componentName,componentType)
Create
© 2006 Progress Software Corporation14ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Diagrams
UML 2.0 Types of Diagrams – Structure Diagrams
© 2006 Progress Software Corporation15ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Structural Diagrams
Captures logical structure of system
UML Class Diagram
cd Ev aluate Testdriv e
Class Name
- Private Attribute: integer+ Public Attribute: character# Protected Attribute: logical~ Package Attribute: decimal
- Private Operation(character, logical) : void+ Public Operation() : void# Protected Operation() : void~ Package Operation() : void
© 2006 Progress Software Corporation16ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Structural Diagrams
Illustrates the pieces of software that will make up a system.
UML Component Diagram
© 2006 Progress Software Corporation17ARCH-2: UML 101 - From Design to Implementation using UML
UML 2.0 Structural Diagrams
Shows how and where the system will be deployed.
UML Deployment Diagram
© 2006 Progress Software Corporation18ARCH-2: UML 101 - From Design to Implementation using UML
UML Modeling
Use Case View
Logical View
Dynamic View
Implementation View
Deployment View
ud Manage Employees
AutoEdge System
Manager
(from Actors)
Browse Employees
Update Employee
Create Employee
Delete Employee
Create User«extend»
«include»
«use»
«use»
cd Users
Architecture Entities::User
- UserEmail: CHARACTER- UserLogin: CHARACTER- UserPassword: CHARACTER
Architecture Entities::UserGroups
- UserGroupDescription: CHARACTER- UserGroupName: CHARACTER
Business Entities::Employee
+ Address: CHARACTER+ City: CHARACTER+ email: CHARACTER- EmployeeLanguage: CHARACTER+ employmentEndDate: DATETIME-TZ+ employmentStartDate: DATE+ FirstName: CHARACTER+ LastName: CHARACTER+ MobilePhoneNumber: CHARACTER+ Notes: CHARACTER+ PhoneNumber: CHARACTER+ Position: CHARACTER+ PostCode: CHARACTER
+ createEmployee() : void+ deleteEmployee() : void+ findEmployee() : void+ isAvailable() : LOGICAL+ updateEmployee() : void+ validateEmployee() : void
Architecture Entities::Language
- Description: CHARACTER- Language: CHARACTER
0..*
1
11
0..* 1
sd Login
Client
(from Architecture Components)
Server Gateway
(from Architecture Components)
Security
(from Architecture Components)
Session Context
(from Architecture Components)
Request("Security", "Login", ...)
isValidUser(Login, password)
ValidUser
[if Valid User]: createSession
sessionID
[if valid user]: sessionID
id Business Entity (Client)
«Program»
proSIproxy.p
- NEW GLOBAL SHARED VARIABLE ghttProxySIproc: HANDLE
+ fetchWhere(CHARACTER, HANDLE, DATASET-HANDLE*) : void+ saveChanges(CHARACTER, HANDLE, CHARACTER*) : void
«Program»
ClientXxx.p
«Include»
proSIproxyStart.i
- NEW GLOBAL SHARED VARIABLE ghProxySIproc:
«Include»
dsXxx.i
- DEFINE DATASET <dataset-def>:
«Include»
etXxx.i
«include»
ttContext.i«includes»
includes
includes
«includes»
«realize PERSISTENT»
includes
dd Integration
HQ System
Sonic
Dealer System 1
Sonic
Dealer System 2
Sonic
Dealer System 3
Sonic
Dealer System n
Sonic
© 2006 Progress Software Corporation19ARCH-2: UML 101 - From Design to Implementation using UML
Model-Driven Architecture (MDA)
© 2006 Progress Software Corporation20ARCH-2: UML 101 - From Design to Implementation using UML
Agenda
Introduction UML 2.0 Diagrams Use Case View Logical View Dynamic View Implementation View Demonstration Q&A
© 2006 Progress Software Corporation21ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Use Case View
Describing system functionality
Gathering requirements• Functional & non-functional requirements
Document functional requirements• UML Use Case Diagram
• Use Case Description Documents
Identify actor(s) and association to use case Create different levels of use cases (re-use!)
© 2006 Progress Software Corporation22ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Use Case Viewud Use Case Package Diagram - Auto Park
AutoPark System
Testdrive Car Pool Maintenance
+ Manage Cars
+ Print l ist of testdrive cars
Testdrive Appointment Maintenance
+ Manage test drive appointments
+ Print and send testdrive invitation
+ Print l ist of testdrive appointments
+ Process evaluation form
+ Process TestDrive Request
+ Request TestDrive
Testdrive Person Maintenance
+ Manage Customers
+ Print l ist of testdrive persons
Use Case Packages
© 2006 Progress Software Corporation23ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Use Case Viewud Testdriv e Appointment Maintenance
AutoPark Testdrive Maintenance
Administrativ e Person
(from Actors)
Sales Person
(from Actors)
Print and send testdriv e inv itation
Print list of testdriv e
appointments
Process ev aluation form
Manage test driv e appointments
Customer
(from Actors)
Request TestDriv e
Process TestDriv e Request
(from Testdrive Person Maintenance)
Manage Customers«extend»
Use Case Diagram
© 2006 Progress Software Corporation24ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Use Case View
Describing use case scenario(s)
Scenario = Use Case Activity Flow
Basic Scenario Alternate Scenario(s)
UML Activity Diagram• Describe what happens, now how!
© 2006 Progress Software Corporation25ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Use Case View
Activity Diagram
ad Activ ity Diagram - Process TestDrive Request
Process TestDrive Request Start
Display List of Requests
«UserActivity»Select Request to process
and rev iew
Delete Request
Process Request
Process TestDrive Request
[Action = REJECT]
[Action = PROCESS]
ad Activ ity Diagram - Process Request
Process Request Start
Validate User
Create TestDriv eAppointment
Business Request?
Create TestDriv e RequestXML File
Process Request End
[BusinessRequest = YES][Business Request = NO]
© 2006 Progress Software Corporation26ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Use Case View
Creating Test Scenarios
Identify paths in activity diagram
Create minimal test-scenarios (using each path once)
Create all possible test-scenarios (combining all paths to create unique scenarios)
© 2006 Progress Software Corporation27ARCH-2: UML 101 - From Design to Implementation using UML
Agenda
Introduction UML 2.0 Diagrams Use Case View Logical View Dynamic View Implementation View Demonstration Q&A
cd Logical View
Ev aluation
- EvalCustomer: name- EvalDate: date- EvalScore: number 1-10
+ validateEvaluation() : void
Testdriv e
- TestdriveDate: date- TestdriveCustomer: customer- TestdriveEmployee: employee- TestdriveCar: car
© 2006 Progress Software Corporation28ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Logical View
Designing The System Structure
Identify entities/things used in use case• Identify attributes
• Identify operations
• Identify entity relations
• Identify multiplicity
Create class diagram
© 2006 Progress Software Corporation29ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Logical View
Class Diagramcd Logical Data Model - Process TestDriv e Requests
Request TestDriv e::Request
- FirstName: CHARACTER- LastName: CHARACTER- Email: CHARACTER- PhoneNumber: CHARACTER- BirthDate: DATE- LicenseDate: DATE- Brand: CHARACTER- Model: CHARACTER- Version: CHARACTER- Engine: CHARACTER- Business: LOGICAL
+ createRequest() : LOGICAL+ deleteRequest() : LOGICAL+ readRequest() : CHARACTER+ findRequest() : CHARACTER
Manage TestDriv e Appointments::TestDriv e
- Date: DATE- EvalForm: LOGICAL- currentCar: Car- currentPerson: Person
+ createTestDrive() : LOGICAL+ deleteTestDrive() : LOGICAL+ readTestDrive() : CHARACTER+ updateTestDrive() : LOGICAL+ findTestDrive() : CHARACTER+ validateTestDrive() : LOGICAL
Manage Cars::Car
- Brand: CHARACTER- Model: CHARACTER- Version: CHARACTER- Color: CHARACTER- Engine: CHARACTER- Fuel: CHARACTER- Description: CHARACTER- AvailForTD: LOGICAL- DateAdded: DATE
+ createCar() : LOGICAL+ deleteCar() : LOGICAL+ readCar() : CHARACTER+ updateCar() : LOGICAL+ findCar() : CHARACTER+ validateCar() : LOGICAL
Manage Customers::Person
- FirstName: CHARACTER- LastName: CHARACTER- PhoneNumber: CHARACTER- BirthDate: DATE- LicenseDate: DATE
+ createCustomer() : LOGICAL+ deleteCustomer() : LOGICAL+ updateCustomer() : LOGICAL+ readCustomer() : CHARACTER+ findCustomer() : CHARACTER+ validateCustomer() : LOGICAL
0..*
1
0..*
1
© 2006 Progress Software Corporation30ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Logical View
Patterns
"A pattern is a proven solution to a problem in a context."
© 2006 Progress Software Corporation31ARCH-2: UML 101 - From Design to Implementation using UML
Agenda
Introduction UML 2.0 Diagrams Requirements Logical View Dynamic View Implementation View Demonstration Q&A
© 2006 Progress Software Corporation32ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Dynamic View
Describing Behavior
Identify objects involved
Identify interactions (messages)• Use public operations
Describe how things work
© 2006 Progress Software Corporation33ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Dynamic View
Describing Behaviorsd Sequence Diagram - Process TestDrive Request (Client)
Client Server
Administrative Person
(from Actors)
Viewer Control Entity Request BE
alt valid request
[true]
[false]
«interface»
Process TestDriveRequest::IProcessTDRequest
listRequests
showSelectScreen
getRequests
getRequests
selectRequest
showRequestDetails
getRequestDetails
getRequestDetails
acceptRequest(request)
processRequest(request)
processRequest(request)
deleteRequest(request)
rejectRequest(request)
deleteRequest(request)
deleteRequest(request)
© 2006 Progress Software Corporation34ARCH-2: UML 101 - From Design to Implementation using UML
Agenda
Introduction UML 2.0 Diagrams Requirements Logical View Dynamic View Implementation View Demonstration Q&A
© 2006 Progress Software Corporation35ARCH-2: UML 101 - From Design to Implementation using UML
AutoPark - Implementation Viewid Manage Customers
«Program»
proSIproxy.p
- NEW GLOBAL SHARED VARIABLE ghttProxySIproc: HANDLE
+ fetchWhere(CHARACTER, HANDLE, DATASET-HANDLE*) : void+ saveChanges(CHARACTER, HANDLE, CHARACTER*) : void
«Include»
proSIproxyStart.i
- NEW GLOBAL SHARED VARIABLE ghProxySIproc:
«Include»
dsPerson.i
- DEFINE DATASET Person:
Manage Customers::CustomerMaintenanceView
«Include»
etPerson.i
CustomerMaintenanceControl «include»
ttContext.i
CustomerMaintenanceModel
CustomerMaintenanceControl.p
+ onValueChangedBrwsCustomer() : void+ onChooseBtnAdd() : void+ onChooseBtnModify() : void+ onChooseBtnDelete() : void+ onChooseButtonOK() : void+ onChooseBtnCancel() : void+ onChooseBtnHelp() : void+ onChooseBtnDone() : void
CustomerMaintenanceModel.p
+ addCustomer() : void+ deleteCustomer() : void+ modifyCustomer() : void+ commitCustomer() : void+ getCustomer() : void
CustomerMaintenanceView.w
«includes»
«realize»
«includes»«includes»
«includes»
«realize»
«realize»
«realize PERSISTENT»
includes
Name:Package:Version:Author:
Manage CustomersManage Customers1.0Frank Beusenberg
© 2006 Progress Software Corporation36ARCH-2: UML 101 - From Design to Implementation using UML
Agenda
Introduction UML 2.0 Diagrams Requirements Logical View Dynamic View Implementation View Demonstration Q&A
© 2006 Progress Software Corporation37ARCH-2: UML 101 - From Design to Implementation using UML
Demonstration
© 2006 Progress Software Corporation38ARCH-2: UML 101 - From Design to Implementation using UML
In Summary
Model & Design• Manage complexity
• Minimize risk
• Facilitate communication
Use UML• De facto standard
• Unambiguous
• Documentation
© 2006 Progress Software Corporation39ARCH-2: UML 101 - From Design to Implementation using UML
For More Information, go to…
ARCH-6: UML Modeling with Enterprise Architect
Relevant Exchange Sessions
© 2006 Progress Software Corporation40ARCH-2: UML 101 - From Design to Implementation using UML
For More Information, go to…
Object Management Group• http://www.omg.org
Hillside.net Patterns Library• http://hillside.net/patterns
Relevant Web Resources
© 2006 Progress Software Corporation41ARCH-2: UML 101 - From Design to Implementation using UML
For More Information, go to…
Addison-Wesley Object Technology Series
UML Distilled Third Edition• Martin Fowler – ISBN 0-321-19368-7
Use Case Driven Object Modeling with UML• Doug Rosenberg – ISBN 0-201-43289-7
Developing Software with UML• Bernd Oestereich – ISBN 0-201-75603-X
Relevant Literature
© 2006 Progress Software Corporation42ARCH-2: UML 101 - From Design to Implementation using UML
Questions?
© 2006 Progress Software Corporation43ARCH-2: UML 101 - From Design to Implementation using UML
Thank you foryour time
© 2006 Progress Software Corporation44ARCH-2: UML 101 - From Design to Implementation using UML