37
Integrating Integrating Architecture Architecture Description Description Languages with a Languages with a Standard Design Standard Design Method Method Jason E. Robbins Nenad Medvidovic David F. Redmiles David S. Rosenblum Information and Computer Science Dept. University of California, Irvine [email protected] du [email protected] [email protected] du [email protected]

Integrating Architecture Description Languages with a Standard Design Method Jason E. Robbins Nenad Medvidovic David F. Redmiles David S. Rosenblum Information

Embed Size (px)

Citation preview

Integrating Architecture Integrating Architecture Description Languages Description Languages with a Standard Design with a Standard Design MethodMethodJason E. RobbinsNenad MedvidovicDavid F. RedmilesDavid S. Rosenblum

Information and Computer Science Dept. University of California, Irvine

[email protected]@ics.uci.edu

[email protected]@ics.uci.edu

OverviewOverview• Introduction, MotivationIntroduction, Motivation

• UML Background, Brief TutorialUML Background, Brief Tutorial– UML ConstructsUML Constructs– A Simplified UML Meta-model A Simplified UML Meta-model – UML Extension MechanismsUML Extension Mechanisms

• Extending UML to Model C2 ArchitecturesExtending UML to Model C2 Architectures

• Extending UML to Model Wright Extending UML to Model Wright ArchitecturesArchitectures

• Discussion: Core Models and ExtensionsDiscussion: Core Models and Extensions

• References and URLs: References and URLs: see www.ics.uci.edu/pub/arch/umlsee www.ics.uci.edu/pub/arch/uml

IntroductionIntroduction• Software architecture focuses on high-level Software architecture focuses on high-level

models of software systemsmodels of software systems– Formalists: Analysis is the main purpose of a modelFormalists: Analysis is the main purpose of a model

ADLs: C2, Wright, Rapide, Darwin, Aesop, etc.ADLs: C2, Wright, Rapide, Darwin, Aesop, etc.

– Practitioners: Communication is the main purposePractitioners: Communication is the main purposeBooch, OMT, OOSE, ROOM, Fusion, etc.Booch, OMT, OOSE, ROOM, Fusion, etc.

• We try to get the best of both worlds:We try to get the best of both worlds:Use a practical, mainstream notation (UML) Use a practical, mainstream notation (UML) but extend it to get the benefits of an ADLbut extend it to get the benefits of an ADL

• We add semantic constraints on the UML We add semantic constraints on the UML meta-model to make it match ADL semanticsmeta-model to make it match ADL semantics

BackgroundBackgroundUML: The Unified Modeling UML: The Unified Modeling LanguageLanguage

• UML unifies UML unifies – Popular OO design notations: Booch, OMT, OOSEPopular OO design notations: Booch, OMT, OOSE

– Many views of the system: object model, state models, Many views of the system: object model, state models, use cases, deployment model, etc.use cases, deployment model, etc.

– Notations used for analysis, design, and implementationNotations used for analysis, design, and implementation

• UML is well definedUML is well defined– UML Meta-model defines what is in a UML modelUML Meta-model defines what is in a UML model

– Object Constraint Language specifies system constraintsObject Constraint Language specifies system constraints

• UML stereotypes allow the notation to be UML stereotypes allow the notation to be extendedextended

Motivation: Why use UML? Motivation: Why use UML? • Fairly complete set of models that work Fairly complete set of models that work

togethertogether– Better than current OO design notationsBetter than current OO design notations

• Reduces training costs, eases communicationReduces training costs, eases communication– The software industry is in an skills/employment crisisThe software industry is in an skills/employment crisis

• Evolving into industry standard, market leaderEvolving into industry standard, market leader– OMG standard scheduled for late 1998OMG standard scheduled for late 1998

– Rational, Microsoft, IBM, ObjectTime, HP, Oracle, MCI Rational, Microsoft, IBM, ObjectTime, HP, Oracle, MCI Systemhouse, Unisys, IntelliCorp, I-Logix, …Systemhouse, Unisys, IntelliCorp, I-Logix, …

– Dozens of tools support UML notation now, Dozens of tools support UML notation now, more semantic support expected next yearmore semantic support expected next year

Motivation: Why use it for Motivation: Why use it for research?research?• Reduces barriers to technology transferReduces barriers to technology transfer

• Easier to explain value added over status quoEasier to explain value added over status quo

• Sets an example of what industry values, and Sets an example of what industry values, and what they can acceptwhat they can accept– Leverages existing skills, trainingLeverages existing skills, training– Extensive tool support from multiple sourcesExtensive tool support from multiple sources– Allows for incremental adoption: use a little at a timeAllows for incremental adoption: use a little at a time– Formalism is behind the scenesFormalism is behind the scenes– Visually more self-explanatory than Booch or OMTVisually more self-explanatory than Booch or OMT

• ““Catch a wave”: make our research exciting by Catch a wave”: make our research exciting by linking it with exciting, growing, current thingslinking it with exciting, growing, current things

UML Constructs: ObjectsUML Constructs: Objects• UML defines constructs for Classes, Attributes, UML defines constructs for Classes, Attributes,

Operations, Associations between classes, Operations, Associations between classes, Class InheritanceClass Inheritance

«optional stereotype»Name of Class

attr1 : data_type = init

oper1 (arg_list) : result_type

«stereotype»Class1

0..*

Class3Class2

Association Nameattr2 : int

{ self.class1.attr2->exists( a | a mod 2 == 0 ) }

Super State Name

UML Constructs: State UML Constructs: State MachinesMachines• UML defines constructs for (Hierarchical) UML defines constructs for (Hierarchical)

States, Transitions, Events, Guards, ActionsStates, Transitions, Events, Guards, Actions

• Based on StatemateBased on Statemate

event(args)[condition]

/action

entry: action_1do: action_2on event : action_3…exit action_4

«stereotype»State Name «stereotype»

State Name

«stereotype»

State Name

UML Constructs: UML Constructs: CollaborationCollaboration

• UML defines constructs for illustrating interactions between UML defines constructs for illustrating interactions between instances that occur as part of a use caseinstances that occur as part of a use case– Example instancesExample instances

– Example messagesExample messages

myWindow

:WindowManager

w2

1: setScreenColors(256)

1.2: repaint()

1.1: repaint()

:Window

UML Constructs: SequencesUML Constructs: Sequences• UML defines constructs for illustrating UML defines constructs for illustrating

interactions between instances that occur as interactions between instances that occur as part of a use casepart of a use case

setScreenColors(256)

repaint()

repaint()

myWindow :WindowManager :Window

UML Constructs: ComponentsUML Constructs: Components• UML defines constructs for software componentsUML defines constructs for software components

• Basically defines Makefile-style dependenciesBasically defines Makefile-style dependencies

«stereotype»

Comp Name

«stereotype»

Comp Name

«stereotype»

Comp Name

Host Name

Host Name

UML Constructs: DeploymentUML Constructs: Deployment• UML defines constructs for software componentsUML defines constructs for software components

• Not very well developedNot very well developed

«stereotype»

Comp Name

«stereotype»

Comp Name

«stereotype»

Comp Name

UML Constructs: Use CasesUML Constructs: Use Cases• Informally enumerate expected classes of Informally enumerate expected classes of

users and usage scenarios (i.e., use cases)users and usage scenarios (i.e., use cases)• Show dependency and inheritance among use Show dependency and inheritance among use

casescases• Useful as an input to formal requirementsUseful as an input to formal requirements

«stereotype»Use Case«stereotype»

Use Case

«stereotype»Use Case

«stereotype»Use Case

UML Constructs: ConstraintsUML Constructs: Constraints

• Any UML model element can have constraints Any UML model element can have constraints applied to itapplied to it– Some constraints are predefined, e.g., {or}, Some constraints are predefined, e.g., {or},

{disjoint}{disjoint}– Others can be written in constraint languages, e.g., Others can be written in constraint languages, e.g.,

OCLOCL– Many examples are discussed belowMany examples are discussed below

• The Object Constraint Language (OCL) is The Object Constraint Language (OCL) is described belowdescribed below

UML Constructs: OtherUML Constructs: Other• Packages: group elements and define name Packages: group elements and define name

spacesspaces

• Dependencies: indicate that if head element Dependencies: indicate that if head element changes, tail element may need revisionchanges, tail element may need revision

• Notes: attach comments to any elementNotes: attach comments to any element

Package contents

«stereotype»State Name «stereotype»

State Name

«stereotype»State Name

Some Comments On This Element

UML ExampleUML Example(self.robot->size) / (self.worker->size) < 0.1

Company

Worker

Robot «Person»Employee

Trainee

Course

0..*

0..*

1..4

1..*1..*

Practitioners View of UMLPractitioners View of UML

• What you have seen up to this point is What you have seen up to this point is probably the type of description most probably the type of description most developers will use when learning UMLdevelopers will use when learning UML– Examples of notation with explanations in Examples of notation with explanations in

EnglishEnglish

• However, UML is defined more formally However, UML is defined more formally with a meta-model and constraints with a meta-model and constraints

Four Levels of ModelingFour Levels of Modeling1 User Objects in the Running System1 User Objects in the Running System

– Run-time instancesRun-time instances– Checking of design constraints on running systemChecking of design constraints on running system

2 Model of System Under Design2 Model of System Under Design– Instances of UML constructsInstances of UML constructs– Specify design constraints on running systemSpecify design constraints on running system– Checking of UML language syntax and semantic Checking of UML language syntax and semantic

constraintsconstraints

3 Meta-model3 Meta-model– Abstract syntax of UML constructs definedAbstract syntax of UML constructs defined– Constraints on use of constructs in ModelConstraints on use of constructs in Model

4 Meta-metamodel4 Meta-metamodel– Data interchange formats between modeling toolsData interchange formats between modeling tools– E.g., CDIF or MOFE.g., CDIF or MOF

Stereotype «Person»Stereotype «Person»

Stereotype Person for instances of meta-class Stereotype Person for instances of meta-class ClassClass

[1] If a person is in any composite relationship, it [1] If a person is in any composite relationship, it must be the composite (not one of the parts)must be the composite (not one of the parts)

self.oclType.role.forAll ( myRole |self.oclType.role.forAll ( myRole |myRole.association.role->exists ( anyRole |myRole.association.role->exists ( anyRole | anyRole.aggregation = composite) implies anyRole.aggregation = composite) implies myRole.aggregation = composite) myRole.aggregation = composite)

• This defines a new kind of class that is like a This defines a new kind of class that is like a regular class, but avoids a certain kind of design regular class, but avoids a certain kind of design errorserrors

Simplified UML Meta-Simplified UML Meta-modelmodel

Feature

Attribute

InterfaceAssociation

Role1..*

0..*2..* {ordered}

0..* {ordered}

Class

Operation

Parameter

0..*

0..*

UML Extension UML Extension MechanismsMechanisms• UML predefines a set of flexible constructsUML predefines a set of flexible constructs

• Tagged values can be applied to any Tagged values can be applied to any constructconstruct

• Constraints can be applied to any constructConstraints can be applied to any construct

• Stereotype are groups of tagged values and Stereotype are groups of tagged values and constraints that can be named and applied to constraints that can be named and applied to any constructany construct– Stereotypes are the main extension mechanismStereotypes are the main extension mechanism

– They add semantics w/out changing UML languageThey add semantics w/out changing UML language

– They can be They can be justjust names, with meaning for humans names, with meaning for humans

Object Constraint Language Object Constraint Language (OCL)(OCL)• Useful forUseful for

– Constraints on classes, associationsConstraints on classes, associations– pre-, post- conditionspre-, post- conditions

• Based on first order predicate logicBased on first order predicate logic– And, or, not, forall, existsAnd, or, not, forall, exists– Set union, intersection, difference, size, etc.Set union, intersection, difference, size, etc.

• Strongly typedStrongly typed

• Adds a navigation language to “move Adds a navigation language to “move around” object models and access around” object models and access attributesattributes

• Every expression is evaluated in the Every expression is evaluated in the context of some constructcontext of some construct

• UML compliant tools must check OCL UML compliant tools must check OCL syntaxsyntax

UML MetricsUML Metrics• ~100 Meta-classes~100 Meta-classes

• ~70 Attributes on those meta-classes~70 Attributes on those meta-classes

• ~190 Associations between meta-classes~190 Associations between meta-classes

• ~180 Constraints on all of that~180 Constraints on all of that

• Graphical Notation Guide, 142 pagesGraphical Notation Guide, 142 pagesSemantic Reference, 162 pagesSemantic Reference, 162 pagesOCL reference, 32 pagesOCL reference, 32 pages

• Several books in print, many more on the Several books in print, many more on the wayway

Making a New Design Making a New Design NotationNotation• Imagine you are designing a new language to Imagine you are designing a new language to

model some aspect of a design/architecturemodel some aspect of a design/architecture– Identify modeling requirementsIdentify modeling requirements– Invent constructs to model objects of concernInvent constructs to model objects of concern– Define a precise meaning for each constructDefine a precise meaning for each construct– Usually a minimum set of constructs is bestUsually a minimum set of constructs is best– Test your language to see if it meets stated needsTest your language to see if it meets stated needs– Document what you have done, e.g. users’ manualDocument what you have done, e.g. users’ manual– Implement tools to support your languageImplement tools to support your language

• This assumes a one-shot process with no reuseThis assumes a one-shot process with no reuse

UML as a Domain Asset for UML as a Domain Asset for a Design Notation Product a Design Notation Product FamilyFamily

• Product families pay offProduct families pay off– Investigate domain requirements, gain experienceInvestigate domain requirements, gain experience– Invest in a reusable domain model and supporting Invest in a reusable domain model and supporting

assetsassets– Only state commonalties in the domain modelOnly state commonalties in the domain model– Leave the specifics for the products in the familyLeave the specifics for the products in the family

• UML’s meta-model as reusable assetUML’s meta-model as reusable asset– not perfect, but usable and useful, based on not perfect, but usable and useful, based on

experienceexperience– UML provides a set of broadly defined constructs that UML provides a set of broadly defined constructs that

might not be defined as precisely as we would likemight not be defined as precisely as we would like– We can “instantiate” UML to make a new design We can “instantiate” UML to make a new design

notation with more specific semanticsnotation with more specific semantics– Still “backward compatible” with standard UML toolsStill “backward compatible” with standard UML tools

UML as a Domain Asset for UML as a Domain Asset for a Design Notation Product a Design Notation Product FamilyFamily

• I feel that ACME and UML are basically on I feel that ACME and UML are basically on the same track, but differ in style and scopethe same track, but differ in style and scope– Meta-model classes: ACME 7, UML 100Meta-model classes: ACME 7, UML 100– Constraint languages: Constraint languages:

ACME uses Armani and more, UML uses OCL and ACME uses Armani and more, UML uses OCL and moremore

– We might prefer to use and teach Scheme, but We might prefer to use and teach Scheme, but industry went for more for Common Lispindustry went for more for Common Lisp

BackgroundBackgroundC2: A Software Architecture StyleC2: A Software Architecture Style

• C2 is a style for building systems with complex C2 is a style for building systems with complex user interfacesuser interfaces

• Architectures consist of components and Architectures consist of components and connectorsconnectors– Architecture is layeredArchitecture is layered

– Connectors broadcast messages up or down one layerConnectors broadcast messages up or down one layer

– Request messages only go up; Notifications only go Request messages only go up; Notifications only go downdown

– Components connect to one connector above and one Components connect to one connector above and one belowbelow

– For more detail see C2 paper in TSE, June 1996For more detail see C2 paper in TSE, June 1996

C2 ExampleC2 Example

Database Component

Admin IU User IU

Window System

Extending UML to C2Extending UML to C2C2 OperationsC2 Operations

• C2 operations are modeled as stereotyped C2 operations are modeled as stereotyped UML operationsUML operations– C2 operations are tagged as notifications or C2 operations are tagged as notifications or

requestsrequests

– C2 messages do not have return valuesC2 messages do not have return values

Stereotype C2Operation for instances of meta-class OperationStereotype C2Operation for instances of meta-class Operation[1] c2MsgType : enum { notification, request }[1] c2MsgType : enum { notification, request }[2] not self.oclType.parameter->exists( p | p.kind = return )[2] not self.oclType.parameter->exists( p | p.kind = return )

Extending UML to C2Extending UML to C2C2 ComponentsC2 Components

• C2 components are modeled as C2 components are modeled as stereotyped UML classesstereotyped UML classes– C2 components have exactly two interfaces, C2 components have exactly two interfaces,

one labeled “top” and one labeled “bottom”one labeled “top” and one labeled “bottom”

– Request messages can only be sent through Request messages can only be sent through the top interface, notifications through the the top interface, notifications through the bottom interface bottom interface

– C2 components contain four predefined C2 components contain four predefined internal partsinternal parts

Extending UML to C2Extending UML to C2C2 ConnectorsC2 Connectors

• C2 connectors are modeled as stereotyped C2 connectors are modeled as stereotyped UML classesUML classes

• A connector’s interface is determined by A connector’s interface is determined by what it is connected to, rather than being what it is connected to, rather than being declareddeclared

• There are only three kinds of associations There are only three kinds of associations allowed between C2 components and C2 allowed between C2 components and C2 connectorsconnectors– C2AttachOverCompC2AttachOverComp connector above connector above

componentcomponent– C2AttachUnderCompC2AttachUnderComp connector below connector below

componentcomponent– C2AttachConnConnC2AttachConnConnconnector to connectorconnector to connector

Extending UML to C2Extending UML to C2C2 ArchitecturesC2 Architectures

• C2 Architectures are modeled as C2 Architectures are modeled as stereotyped UML SystemModelsstereotyped UML SystemModels

• C2 architectures can only contain C2 architectures can only contain elements with C2 stereotypeselements with C2 stereotypes

• The number of attachments each The number of attachments each component has is limited to one above component has is limited to one above and one belowand one below

• Each component must attach to Each component must attach to somethingsomethingLet comps = self.oclType.elements->select(e |Let comps = self.oclType.elements->select(e |

e.stereotype = C2Component),e.stereotype = C2Component),comps.role.association->size > 0comps.role.association->size > 0

C2 Example in UMLC2 Example in UML«C2Component»

Database Componentrqst rcvd changeSchema() note sent changedSchema()

«C2Component»Admin UI

rqst sent changeSchema() note rcvd changedSchema()

«C2Component»Database Component

rqst sent update() note rcvd changedSchema()

«C2Connector»Connector_One

«C2AttachOverComp»«C2AttachOverComp»

«C2AttachUnderComp»

DiscussionDiscussionModeling C2 Architectures in UMLModeling C2 Architectures in UML

• Modeling our style was fairly straightforwardModeling our style was fairly straightforward– UML provides a good set of broadly defined meta-UML provides a good set of broadly defined meta-

classes that can be constrained to mean what we classes that can be constrained to mean what we wanted to saywanted to say

– Many C2 concepts are similar to those of OO Many C2 concepts are similar to those of OO designdesign

– Some concepts are very differentSome concepts are very different

• We can represent similar concepts in UML We can represent similar concepts in UML and treat others as annotationsand treat others as annotations– Similar concepts might be checked by UML/OCL Similar concepts might be checked by UML/OCL

toolstools– C2 specific concepts may still need special toolsC2 specific concepts may still need special tools

Extending UML to WrightExtending UML to Wright• Wright describes system topology and Wright describes system topology and

behavior of components and connectors behavior of components and connectors with CSPwith CSP

• Topology can be constrained as done in the Topology can be constrained as done in the C2 extensionC2 extension

• CSP processes are like UML objects with CSP processes are like UML objects with state machines inside, in fact we can define state machines inside, in fact we can define a mapping from CSP constructs to state a mapping from CSP constructs to state machine constructsmachine constructs

• CSP communication can be mapped to UML CSP communication can be mapped to UML messagesmessages

DiscussionDiscussionCore Models and ExtensionsCore Models and Extensions

• We propose using a We propose using a core modelcore model (UML) with a (UML) with a core processcore process and adding ADL extensions as and adding ADL extensions as neededneeded– Places emphasis on day-to-day development Places emphasis on day-to-day development

needs;needs;Leverages standard notations, tools, and skillsLeverages standard notations, tools, and skills

– Architecture questions can be answered as they Architecture questions can be answered as they arisearise

– Adds practicality to ADLs, analysis possibilities to Adds practicality to ADLs, analysis possibilities to UMLUML

– Conflicts between extensions can arise, must be Conflicts between extensions can arise, must be managedmanaged

Core Model (UML)

ADL specific extensions

DiscussionDiscussionCore Models and ExtensionsCore Models and Extensions

• Analysis is a key goal for architectureAnalysis is a key goal for architecture

• Where does architecture fit in process?Where does architecture fit in process?– Can’t always answer questions before they ariseCan’t always answer questions before they arise– Don’t just stick architecture early in the waterfallDon’t just stick architecture early in the waterfall– Use architecture to identify/resolve risks Use architecture to identify/resolve risks

throughoutthroughout

UML ADL

ADL

ADL

Architecture