Hi,


I've got two metafacades here, which both indirectly inherit from 
ClassifierFacade, let's call them C1 and C2.

I've also got a metafacade which inherits from AssociationEndFacade, call that 
A. Now I'd like the associationEnds which belong to C1's to be of type A, while 
those belonging to C2's should just be normal AssociationEnds.



I would have thought that this could be accomplished in 
andromda-metafacades.xml by means of the "context" mechanism, i.e. state that A 
should be used when the context is C1, like this:



    <metafacade class="org.andromda.cartridges.stmdsoc.metafacades.A">

        <mapping class="org.omg.uml.foundation.core.AssociationEnd$Impl">

   <context>org.andromda.cartridges.stmdsoc.metafacades.C1</context>

  </mapping>

    </metafacade>



However, this only seems to work half and half:

(suppose there is only one association, which is between a C1 and a C2)



When I obtain a C2, I get the following:

$myC2.associationEnds.iterator().next().class: AssociationEnd // correct

$myC2.associationEnds.iterator().next().otherEnd.class: A // correct

$myC2.associationEnds.iterator().next().otherEnd.otherEnd.class: A // wrong!



When I obtain a C1, I get this:

$myC1.associationEnds.iterator().next().class: A // correct

$myC1.associationEnds.iterator().next().otherEnd.class: A // wrong!

$myC1.associationEnds.iterator().next().otherEnd.otherEnd.class: A // right

$myC1.associationEnds.iterator().next().otherEnd.type.associationEnds.iterator().next().class:
 AssociationEnd // right!



In other words:

- starting from a classifier, getting an associationEnd will always return one 
with the correct facade

- travelling to the other end of an associationEnd should always change the 
facade from A to AssociationEnd or the other way round, since the context 
should have changed, but this only works when going from C2 to C1, not in the 
other direction. In the other direction, the facade of the associationEnd is of 
the wrong type, but going from there to its type, and then back will fix it 
(probably because this triggers the context change?)





I hope the problem is clear, but anyway, the question is: When exactly is a 
context change triggered? Why is it changed when going from C2 to C1, but not 
in the other direction? Note that both C1 and C2 have been declared with 
contextRoot="true" in andromda-metafacades.xml



this is andromda 3.0 final...



Thanks,



Hans
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=1975#1975
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to