13.07.2015 Views

Modeling Software Architectures in the Unified Modeling Language

Modeling Software Architectures in the Unified Modeling Language

Modeling Software Architectures in the Unified Modeling Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Model<strong>in</strong>g</strong> <strong>Software</strong> <strong>Architectures</strong> <strong>in</strong> UML • 33--3-- An “action” transition consists of a null event and a s<strong>in</strong>gle action-- (Figure 14b).self.WSMtransitionType = action implies(self.event->isEmpty and self.action->size = 1)Stereotype WrightState for <strong>in</strong>stances of meta class State--1-- All Transitions <strong>in</strong> a composite WrightState must be WSMTransitionsself.oclIsK<strong>in</strong>dOf(CompositeState) impliesself.transition->forAll(t | t.stereotype = WSMTransition)--2-- WrightState applies recursively to its nested statesself.oclIsK<strong>in</strong>dOf(CompositeState) implies(self.oclAsType(CompositeState).state->forAll(s |s.stereotype = WrightState))Stereotype WrightStateMach<strong>in</strong>e for <strong>in</strong>stances of meta class StateMach<strong>in</strong>e--1-- A WrightStateMach<strong>in</strong>e consists of one of <strong>the</strong> composite states discussed-- above, and partially depicted <strong>in</strong> Table 2. This constra<strong>in</strong>t is elided <strong>in</strong> <strong>the</strong>-- <strong>in</strong>terest of space.--2-- All WrightStateMach<strong>in</strong>e transitions must be WSMTransitions.self.top.oclIsK<strong>in</strong>dOf(CompositeState) impliesself.top.transition->forAll(t | t.stereotype = WSMTransition)--3-- The nested states of <strong>the</strong> top state of a WrightStateMach<strong>in</strong>e must be-- WrightStatesself.top.oclIsK<strong>in</strong>dOf(CompositeState) implies(self.top.oclAsType(CompositeState).state->forAll(s |s.stereotype = WrightState))The stereotypes above use <strong>the</strong> operation oclAsType to coerce <strong>the</strong> associatedmodel element to <strong>the</strong> specified class of <strong>the</strong> meta model, <strong>the</strong>reby provid<strong>in</strong>g accessto <strong>the</strong> o<strong>the</strong>r meta model elements accessible from <strong>the</strong> specified meta class. Theyalso illustrate <strong>the</strong> basic pattern we use to constra<strong>in</strong> state mach<strong>in</strong>es, namely,express<strong>in</strong>g constra<strong>in</strong>ts <strong>in</strong> terms of model elements reachable from <strong>the</strong> s<strong>in</strong>gle,top-level state of a state mach<strong>in</strong>e (i.e., its attribute top).5.2.2 Wright Component and Connector Interfaces <strong>in</strong> UML. Each Wright<strong>in</strong>terface (a port <strong>in</strong> a component or a role <strong>in</strong> a connector) has one or moreoperations. In Wright, <strong>the</strong>se operations are modeled implicitly, as part ofa port or role’s CSP protocol. We choose to model <strong>the</strong> operations explicitly<strong>in</strong> UML. The CSP protocols associated with a port or role are modeled asWrightStateMach<strong>in</strong>es.Stereotype WrightOperation for <strong>in</strong>stances of meta class Operation--1-- WrightOperations do not have parameters; parameters are implicit <strong>in</strong> <strong>the</strong>-- CSP specification associated with each operation.ACM Transactions on <strong>Software</strong> Eng<strong>in</strong>eer<strong>in</strong>g and Methodology, Vol. 11, No. 1, January 2002.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!