hmm... ok, I take another example:
I want to generate an Exception for every <<Entity>>, and every <<Service>>. All exceptions should have the same structure, the difference is just the Name. For getting the name I need some logic. (i.e. putting a suffix "PersistenceException" or "ServiceException"). So, now I have more than one way to solve this: 1. Logic in the template: #if($class.isService) #set($className = "${class.name}ServiceException") #elseif ($class.isEntity) #set($className = "${class.name}PersistenceException") #end I think, this is not the proper position for this logic. I think its better to do that in a MetaFacage. So, we come to solution 2: 2. Doing the name-logic in the MetaFacade Then I have in each of my EntityFacade and my ServiceFacade a method "getExceptionName". I can call this method in every template, where I use the EntityFacade repectively the ServiceFacade. So, I think, thats also not a good way. Thats the reason why I want to use version 3: 3. using a special EntityExceptionFacade and a ServiceExceptionFacade This special facades can handle the functionality to generate the Exception-Name. And in the template-deskriptor I want to do this: cartridge.xml: <template path="templates/mytemplates/service.java.vsl" outputPattern="$generatedFile" outlet="exceptions" generateEmptyFiles="false" overwrite="true"> <modelElements variable="service"> <modelElement stereotype="Service"> <type name="de.dpcom.metafacades.uml.ServiceFacade"/> </modelElement> </modelElements> </template> <template path="templates/mytemplates/entity.java.vsl" outputPattern="$generatedFile" outlet="exceptions" generateEmptyFiles="false" overwrite="true"> <modelElements variable="entity"> <modelElement stereotype="Entity"> <type name="de.dpcom.metafacades.uml.EntityFacade"/> </modelElement> </modelElements> </template> <template path="templates/mytemplates/exception.java.vsl" outputPattern="$generatedFile" outlet="exceptions" generateEmptyFiles="false" overwrite="true"> <modelElements variable="exception"> <modelElement stereotype="Entity"> <type name="de.dpcom.metafacades.uml.EntityExceptionFacade"/> </modelElement> <modelElement stereotype="Service"> <type name="de.dpcom.metafacades.uml.ServiceExceptionFacade"/> </modelElement> </modelElements> </template> metafacades.xml: <metafacade class="de.dpcom.metafacades.uml.ServiceFacadeLogicImpl"> <mapping class="org.omg.uml.foundation.core.Classifier$Impl"> <stereotype>Service</stereotype> </mapping> </metafacade> <metafacade class="de.dpcom.metafacades.uml.EntityFacadeLogicImpl"> <mapping class="org.omg.uml.foundation.core.Classifier$Impl"> <stereotype>Entity</stereotype> </mapping> </metafacade> <metafacade class="de.dpcom.metafacades.uml.ServiceExceptionFacadeLogicImpl"> <mapping class="org.omg.uml.foundation.core.Classifier$Impl"> <stereotype>Service</stereotype> </mapping> </metafacade> <metafacade class="de.dpcom.metafacades.uml.EntityExceptionFacadeLogicImpl"> <mapping class="org.omg.uml.foundation.core.Classifier$Impl"> <stereotype>Entity</stereotype> </mapping> </metafacade> But If I do this, nothing is generated for my Exceptions... Do you understand now, what I want to do? MArtin -- AVIs Samsung-Forum: www.samsung-forum.de _________________________________________________________ Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=2428#2428 Posting to http://forum.andromda.org/ is preferred over posting to the mailing list! ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar _______________________________________________ Andromda-user mailing list Andromda-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/andromda-user