Model-Driven Evolution of Software Architectures - Software and ...
Model-Driven Evolution of Software Architectures - Software and ...
Model-Driven Evolution of Software Architectures - Software and ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
5.6. ApplicationtoOcé 95<br />
rule TopCompositeState {<br />
from cs_in:UML!CompositeState<br />
using {<br />
sm:UML!StateMachine=thisModule.allStateMachines->select(sm|sm.top<br />
=cs_in);<br />
}<br />
to cs_out:UML!CompositeState (<br />
name collect(cs|thisModule.CompositeState(sm,cs))))<br />
}<br />
rule CompositeState (sm:UML!StateMachine, cset:Set(UML!Constraint))<br />
{<br />
to cs:UML!CompositeState(<br />
subvertex union(sm.<br />
compositeStateConstraintSeqsAt(cset)->collect(cs|thisModule.<br />
CompositeState(sm,cs))))<br />
do{cs;}<br />
}<br />
Listing 5.4:Addinghierarchytostatemachine<br />
tobeintheindicatedstate.Hence,weattachacorrespondingprecondition<br />
tothemessage. Figure5.7onthenextpageshowsanexample. Finally,<br />
weadda(public)attribute, state,totheclasscorrespondingtothe ESM<br />
component.<br />
5.6.2 Results<br />
Afragment<strong>of</strong>theresult<strong>of</strong>application<strong>of</strong>thetransformationstepstoOcé’s<br />
ESMcomponent,isdepictedinFigure5.8onpage97. Thedashedline<br />
indicatesthepaththroughthestatemachinethatistraversedwhenESM<br />
isrequestedtogotost<strong>and</strong>bywhileitisrunning.Thispathcorrespondsto<br />
thescenariodepictedinFigure5.7onthenextpage.<br />
Wecomparedthisderivedstatemachinewiththeimplementationstate<br />
machine,fromwhichOcégeneratescode. Therearemanyinconsistencieswithrespecttolow-levelstates<strong>and</strong>transitions.Intheimplementationstatemachinelow-levelstatesarenotonlydecomposedfurther,the<br />
sequence<strong>of</strong>states<strong>and</strong>transitionsisalsodifferentinmanycases. This<br />
isnotsurprisingconsideringthefactthatthesequencediagrams<strong>of</strong>the<br />
sourcemodelfromwhichwederivedastatemachine,constitutethefirst<br />
behaviouralmodelthatiscreatedforthe ESMcomponent,while,inthe<br />
implementationstatemachine,low-leveltransitions<strong>and</strong>states<strong>of</strong>tencorrespondtoasinglemethodcallinthegeneratedcode.<br />
Ifwerestrictthe