UML 2 in Together 2006 An Introduction to Model Driven Development and new capabilities of UML 2.
-
Upload
dora-morgan -
Category
Documents
-
view
213 -
download
0
Transcript of UML 2 in Together 2006 An Introduction to Model Driven Development and new capabilities of UML 2.
UML 2 in Together 2006
An Introduction to Model Driven Development
and new capabilities of UML 2
Scope:
UML 2 adds new modeling capabilities. These fall into two categories:
Advances in modelling static structures such as components Strengthening the ability to model dynamic behavior
Interactions expand on Sequence Diagrams Activities and Actions expand on the old Activity Diagram Statemachines expand the former Statechart Diagram
We cannot show it all in one hour We don't want to limit the audience to modeling experts
So we will work with just two kinds of diagram We will illustrate the work as we go, using Together 2006
Overall Goal:
Construct a unified model using new UML 2 capabilities Class diagram as extended for encapsulated behaviored classes Behavior Model, using the activity diagram, likewise extended Unify the two thru the new common behavior model of UML2
Behaviored Classifier owns behaviors and behavioral features. Encapsulated Classifier controls communications by using ports Behaviors are “specified” by behavioral features Classifiers can own behaviors that execute on instantiation.
Three steps: Class diagram for static structural view. Activity diagram for dynamic behavior view. Set the SW_DevProject class as the context for its behavior:
Assign a Behavior as the essential behavior of the object class
Intermediate Goal: Make this class diagram.
RoleOfPerson
RoleOfArtifact
SW_DevProject
ManagedWork
PersonKind
kindCodekindDescription:String
ProjectKind
kindCodekindDescription:String
Person
Store
<<enumeration>>ProjectStatus
greenyellowredcancelled
StoreKind
kindCodekindDescription:String
Artifact
ArtifactKind
kindCodekindDescription:String
enact
Location
assignedKind 1..1
kind
0..*
status
0..*content
1..1
kind
0..*
worker
asPlanned
ownedProjectLog
0..1
asExecuted
1..1
kind
allocations1..*
workspace
0..*0..* workthing
1..1
kind
0..*repository
And understand what it means New UML 2 features: ports and associations
The Diagram Shows Classes for:
Software Development Projects: SW_DevProject A behaviored classifier, with a port and an Inner Class
An enumeration type for project status values. A class for cataloging standard kinds of project (blue) A class for the storage resources available to Project. Persons to participate in Projects (color modeling green) An association class for the locating Artifacts in Stores. An Artifact class for documents, files, and executables. An ArtifactRole class for different ways artifacts relate:
Some are resources used by the project Others are workproducts created by the project And so on…
Methodology
In line with the SDO Theme of DevCon, we will Take Software Development Projects as our subject, Resulting in a self-referential project for the problem domain of
software development projects.
MODEL DRIVEN DEVELOPMENT (not MDA but MDD) Start with a model of the problem domain. Feel free to go beyond the view of projects found in current
tools. Emphasis on what SW Projects really involve, move to SDO.
At the end, we want a model of software development to use as the context for later development of support tools.
Create a new project.
Remember, it will be a project that will model what a project is. Self referential stuff happening.
File | New | Project | Wizard List
New Project has top-level diagram.
Unfold the Project node.
UML organizes by Package
We choose to model from two points of view: Static Structure, using a Class Diagram Dynamic Behavior, in this case, Activity Diagram
This is a good approach, but not the only one. We will create a modeling package for each view:
Our first package will be named
staticProjectStructure The intent is to represent the “real-world” items that
make up a software development project. Package will hold a class from which to instantiate:
SW development projects
Create package to organize the model.
Use any of three views to rename package.
New package gets its own package diagram.
Create a class to represent Software Projects.
Make it pretty.
Add behavioral features. AKA operations.
Specify the operations with signatures.
OOPs! Undo
We need to see how to add operations to Classes But this is old UML 1 stuff Let's represent the behavior of SW projects UML 2 style
Behavior
Operation
Parameter
Constraint
BehavioralFeature
BehavioredClassifier
context
ownedBehavior
classifierBehavior
{ordered}
ownedMember
precondition
postconditionspecification
Part of the extended UML 2 Metamodel
Central domain entity has dynamic behavior
SW_DevProject
Elaborate the static model.
Store
Artifact
SW_DevProject
:
ArtifactKind
kindCodekindDescription:String
ProjectKind
kindCodekindDescription:String
StoreKind
kindCodekindDescription:String
1..*
output
1..*
input
1..*
workspace
1..1
1..1
1..1
Apply the color pattern where appropriate.
MomentInterval
dateOrTimeInterval
ThingRole
roleName:String
listRoles
Thing
serialNumber:String
+listThings
ThingDescription
type
listDescriptions
o..*0..*1..10..* 1..10..*
Simplified view of the Domain Neutral Component
PlaceRole
roleName: StringroleSpecificAttribute
listRoles
Place
serialNumber: StringparticularDescription
+listThings
PartyRole1
roleName: StringroleSpecificAttribute
listRoles
PartyDescription
typereusableDescription
listDescriptions
Party
serialNumber: StringparticularDescription
+listThings
ThingRole
roleName: StringroleSpecificAttribute
listRoles
Thing
serialNumber: StringparticularDescription
+listThings
ThingDescription
typereusableDescription
listDescriptions
MomentI ntervalDetail
dateOrTimeI nterval
calcTotal
MomentI nterval
status
generateNextgenerateMI DetailcalcTotalAcrossMI DetailsassessWRTnextassessWRTactuallistMI DetailslistMI s
PlaceDescription
typereusableDescription
listDescriptions
1..10..*1..10..*
1..*
planactual
o..*0..*
1..10..* 1..10..*
1..10..*0..*1..1
0..*1..1
next
0..1
1..10..*
More detailed view of the color pattern DNC.
The Domain Neutral Component in more detail.
Apply the Domain Neutral Component
PersonRoleOfPerson
Store
RoleOfArtifact
StoreKind
kindCodekindDescription:String
PersonKind
kindCodekindDescription:String
SW_DevProject
ArtifactKind
kindCodekindDescription:String
ProjectKind
kindCodekindDescription:String
<<enumeration>>ProjectStatus
greenyellowredcancelled
Artifact
location
resource
assignedKind
1..1
kind
0..*
1..1
kind
0..*
worker
asPlanned
0..1
asExecuted
1..1
kindallocatedWorkspaces 1..*
workspace
0..*0..*
workthing
1..1
kind
status
Upgrade the location relationship to first-class UML 2 has stronger support for Association Classes Allows adding ends to model n-tuples No rolename for association because it is not an end.
The Behaviored Classifier
And Structured Classifier Stronger ability to model component structures
Using Together to peek at the metamodel.
Structured Classifier Notation with Interfaces
Interface1
EncapsulatedClassifier B
OtherPart[1]
OtherPart2[1]
Port
Port
EncapsulatedClassifier A
-Part1[1]
Part[1]Port
PortInterface2
Interface3
Required
Provided
Adding a behavior port.
change isBehavior isService
Together automatically maintains Package Diagram.
Adding an Inner Class
A project involves work that produces the deliverables.
Create class for ManagedWork in the diagram for package.
Drag and drop it into the SW_DevProject class.
View of the resulting diagram
RoleOfPerson
RoleOfArtifact
SW_DevProject
ManagedWork
PersonKind
kindCodekindDescription:String
ProjectKind
kindCodekindDescription:String
Person
Store
<<enumeration>>ProjectStatus
greenyellowredcancelled
StoreKind
kindCodekindDescription:String
Artifact
ArtifactKind
kindCodekindDescription:String
enact
Location
assignedKind 1..1
kind
0..*
status
0..*content
1..1
kind
0..*
worker
asPlanned
ownedProjectLog
0..1
asExecuted
1..1
kind
allocations1..*
workspace
0..*0..* workthing
1..1
kind
0..*repository
Close and reopen.
Goal 2: Make an Activity diagram.
PhaseActivity
Produce Workproducts
realizations
Review Workproducts
valuations
<<datastore>>PhaseRepository
TimeBoxLimit
Define Workproducts
Define Schedule
specifications
schedule
workproduct output
We may choose to do a new diagram in class. But it will be similar to this and for the same domain. Then connect the Activity to the SW_DevProject Class
Add second package for dynamic view.
As with all things, work graphically if you wish.
Package “dynamicProjectBehavior”
An empty package with an empty diagram.
We need to model a behavior in this package.
A StateMachine or Interaction model could be used. We choose to model project behavior as Activity
Behavior Parameter
Constraint
BehavioralFeature
BehavioredClassifier
Operation Activity StateMachine I nteraction
context
ownedBehavior
classifierBehavior
{ordered}
ownedMember
precondition
postcondition
specification
precondition
postcondition
ownedMember
Activity is one specialization of Behavior.
Using Together to peek at the metamodel.
To make them able to matchOperations (aka Functions)the UML 2 Behaviors have Parameter Sets.
So create an Activity in an ActivityDiagram
WorkAccordingToScrum
Activities can represent Control Flows.
ActivityWithFlows
Action
Action
Action
Action
Action
[true]
[false]
Control Flow Nodes
Control Flows with Guard Expressions Initial Final Ends the Entire Activity Process
FlowFinal is a useful new capability for local "thread" death
Decision branch merge
Fork Join
Although they use the same graphic, the syntax of Fork and Join are different, likewise wrt Branch and Merge.
Only one path can be taken in executing this.
Need x-or guard conditions
Nonsense Random Waving Activity
High-Five Boris's Right
High-Five Boris's Left
High-Five Karl's Left
High-Five Karl's Right
MergeNode
DecisionNode
Non-Sequential, Maybe Concurrent/ParallelDouble-High-Five Activity
High-Five Boris's Right
High-Five Boris's Left
High-Five Karl's Left
High-Five Karl's Right
Missing Concept: do all 4 actions occur at same TIME?
Compare with an alternative notation
TerminateEvent
Event1 Event2 Event3 Event4
Event1 Event4Event2 Event3
Event1 Event2 Event3 Event4
Event1 Event2 Event3 Event4
Called "swimlanes" or "partitions". Difference is that Lanes are labelled by responsible party
Semantic-Aware Tools For Activities
Data Flow Arrows are different From Control Flow Input and Output Pins can be Typed for ObjectFlows
Control Flow Elements
Data Flow Elements
Make this process the “classifier behavior”.
Set the context for this Activity to be ManagedWork
Three Behaviors Modeled In Together
Top-Level Project Behavior Generic Phase of a Project – not methodology specific Development Work by Scrum
Project
projectExecutionProcess
ProjectReport<<datastore>>ProjectStore
DeliverOutcomeInvokeManagedWork
cancellationSignal
ProjectTimeExceeded
ReleaseResourcesAcquireResources
ReviewProject
outputinput
start review
[nextPhase=yes]
[nextPhase=no]
artifacts used
artifacts delivered
Phase
PhaseActivity
Produce Workproducts
realizations
Review Workproducts
valuations
<<datastore>>PhaseRepository
TimeBoxLimit
Define Workproducts
Define Schedule
specifications
schedule
workproduct output
ScrumWorkAccordingToScrum
aBackLogItem
<<datastore>>ProductBacklo
g
PrioritizeBacklogAdd To BacklogNew Item
sprintPlanningSessioinStart
SelectItemsForSprintBacklog
<<centralBuffer>>SprintBacklog
RealizeItemsFromSprintBacklog
<<datastore>>ProjectWorkproducts
DemonstrateScrumRealizations
aWorkingExecutable
aBackLogItem
MergeNode20
AnotherSprint?
SprintEndSignal
[developer available = true]
[anotherSprint = true]
Final
FlowFinal