Lofi Dewanto wrote:
Hi Wouter,
after reading more I can summarize following as the steps to build your own cartridges:
1. Build the directory structure of the cartridge just like other cartridges.
2. Build the UML file (Metafacade Model) for the cartridge inside the "src/uml".
oh yeah, just make sure to respect the naming conventions. For consistency.
you really want to use Poseidon ? Are you a masochist or something ? :-)Q: I see that this UML file has a dependency to the metafacades: UMLMetafacadeModel3xxx.zip. Is this a must? Because Poseidon cannot do this, I think. Do you have a template file for Poseidon, so that the development of this Metafacade Model will be easier for Poseidon users?
dude, really, unless your JVM is running on a farm of Pentium4's you should use MagicDraw community edition
Chad could you help him for this one ? I am not sure what to answer...
3. Generate the codes for my own cartridge by using the andromda-meta cartridge.
Q: Do I have an Ant script for this purpose? Do you have an example build script with Ant for this purpose?
:-)
you can use AndroMDA's ant task to do this, just make sure to put the meta-cartridge on the classpath, but it is definately easier to directly add your code to your local AndroMDA source tree and benefit from all the work Chad did.
anyway ... building the facades is the same as building the EJB beans from the UML, you just need to run andromda as you have been doing until now
more info here: http://www.andromda.org/docs/andromda-meta-cartridge/index.html
exactly, you can always work with that default model and decide not to do anything else ... but from the moment you want specific PSM features in the facades you will need to extend them through a generalization and add you own methods, but again you do not need to if you don't want
4. Implement the needed methods within the generated files.
5. Compile my own cartridge.
Q: Do I have an Ant script file for this?
For the question in my last email: the standard behaviour (without
your own Metafacade Model like the Java cartridge) is the MetafacadeModel, correct? So if I don't need any special behaviours,
I only need to look at the Metafacade Model.
A question: I saw that something like:
$class.packageName $class.name
Q: After reading the Metafacade Model, I find these properties in ModelElementFacade class. Is it better to use the notation above intead of $class.getName() or $class.getPackageName() in my templates?
you can choose. the former is a shorthand for the latter
if there are no arguments people tend to use the former because it is 'lighter'
you can also do $assocEnd.target.navigable instead of $assocEnd.target.isNavigable()
velocity will resolve all that stuff
you will also find this: ${class.name}, this is because sometimes you will want to have parentheses right after this propery, using the braces you tell velocity to stop interpreting features for the property, you understand the difference between $class.name() and $class.name of course.
The last question for today ;-)
Do we really have "Metafacades" for all the modelling elements? Just like: ModelElement -> ModelElementFacade Classifier -> ClassifierFacade ... So, if I want to programmatically access the JMI, I actually can use those facades?
yep. maybe not really all of them, but you will definately not have those low-level JMI elements exposed in your templates. because in AndroMDA we abstract from the uml implementation, meaning: we declare the abstract facade interfaces and we plug the (UML 1.4) implementation underneath ... the purpose is to seemlessly be able to switch to another implementation by simply adding the implementation library. We distinguish these two libraries: andromda-metafacades-uml-3.0M2-SNAPSHOT.jar and andromda-metafacades-uml14-3.0M2-SNAPSHOT.jar (don't worry if this confuses you)
by default andromda maps facades to those JMI model elements, you will need to override those mappings with your own for you specific set of facades in the cartridge/META-INF directory, in the file called andromda-metafacades.xml
(in fact we should be able to generate this XML from the cartridge UML model ... hmmm... gonna add this to my @todo list)
Thanks!
sure b-bye
-- Wouter
------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ Andromda-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/andromda-user
