11.12.2012 Views

Model-Driven Evolution of Software Architectures - Software and ...

Model-Driven Evolution of Software Architectures - Software and ...

Model-Driven Evolution of Software Architectures - Software and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

7.8. Transformation 153<br />

Foreveryelementinthesourcemodelthatmatchesthesourcepattern<br />

<strong>of</strong>arule,theelementsspecifiedbythetargetpatternarecreatedinthetargetmodel.NotethatinATL,thesourcemodelisread-only<strong>and</strong>thetarget<br />

modeliswrite-only.ThiscanalsobeseenfromListing7.2,whereonlythe<br />

sourcemodelisnavigatedtoinitialisethefeaturesreferredtointhebindings<strong>of</strong>thetargetpattern.Therefore,aspecificvalue-resolutionalgorithm<br />

isusedtoinitialisefeatures:iftheexpression<strong>of</strong>abindingreferstoanother<br />

targetelement(createdbythesamerule)itissimplyassigned,ifitrefers<br />

toasourceelementitisresolvedbyapplication<strong>of</strong>therulethatmatches<br />

thatsourceelement<strong>and</strong>takingthedefault(first)targetelement.<br />

Forcaseswheretherequiredtargetelementisnotthedefaultelement<br />

<strong>of</strong>anotherrule,ATL<strong>of</strong>fersthe‘resolveTemp’construct,aso-calledhelper<br />

operation. Ittakesasourcemodelelement<strong>and</strong>areferencetoaspecific<br />

targetelement<strong>of</strong>thematchingruleasinputparameters.InListing7.2,for<br />

example,thisisdoneinthebinding<strong>of</strong>thebehaviourfeature.Inthiscases.<br />

behaviourStateevaluatestoaSimpleStatethatismatchedbyanotherrule<br />

withmultipletargetelements,<strong>of</strong>whichthe ‘b’targetelementisselected<br />

tobindtothatfeature.<br />

Helpersaretypicallydefinedinthecontext<strong>of</strong>ametamodelelement<strong>and</strong><br />

effectivelyaddafeatureoroperationtoinstances<strong>of</strong>thatelement(cf. the<br />

use<strong>of</strong>OCLdefinitionconstraintsinListing7.1onpage144).Alternatively,<br />

ahelpercanbedefinedwithoutanycontext. Then,thedefaultcontext<strong>of</strong><br />

thecompletetransformationmodule,representedbythe thisModuleelement,applies.<br />

The resolveTemphelperisalsodefinedinthisdefaultcontext.<br />

7.8.2 BasicTarget<strong>Model</strong>Elements<br />

SimpleTask<strong>and</strong>Behaviour SimpleTaskscorrespondtomanufacturingactivities,<strong>and</strong>Behaviourscorrespondtotypes<strong>of</strong>manufacturingactivitiesinSMC<br />

systems. Therefore,tocreateSimpleTasks<strong>and</strong>Behavioursinthetarget<br />

modelweneedtoidentifyActionscorrespondingtomanufacturingactivitiesinthesourcemodel.AccordingtotheUMLSMCpr<strong>of</strong>ile,anActionthatcorrespondstoamanufacturingactivityhasnostereotype<strong>and</strong>isexecutedasaStateentryAction(see<br />

C3inListing7.1onpage144). ForeverysuchAction,aSimple-<br />

Taskneedstobecreated. ThisisspecifiedbytheruleinListing7.3on<br />

thenextpage.Itcontainsaguardthatusesthe behaviourStateshelperto<br />

onlymatchSimpleStatesthatmaptoaBehaviour.Notethatinthespecification,wedonotmapActionstoSimpleTasks,butinsteadwemaptheSimpleStatesinwhichtheyareexecutedtoSimpleTasks.ThisdoesnotaffectourmigrationresultssinceActionscorrespondingtoSimpleTasksare<br />

alwaysStateentryActions(byconstraintC3<strong>of</strong>theSMCpr<strong>of</strong>ile).

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

Saved successfully!

Ooh no, something went wrong!