10 steps to write a cartridge

This article shows you how to write an AndroMDA cartridge in 10 distinct steps, using a sample cartridge which generates an Ant-like build script from a UML deployment model. This is why the tutorial cartridge is called "andromda-deployment".

Model and generate PSM metaclasses

In one of the previous steps, "Identify and design PSM metaclasses", you have already found your key concepts of the target platform for which you want to generate code in the end. You will have modeled them using class diagrams. Assign the stereotype <<PSMmetaclass>> to each one of those classes and put them into a separate package called *.psm to keep them separate from the metafacade classes which are yet to come.

The AndroMDA Java cartridge will generate a value object-like Java class for each <<PSMmetaclass>>. So, make sure that the build process for your cartridge project activates both the andromda-meta and the andromda-java cartridges.

Note: You need at least AndroMDA release 3.2 to have the stereotype <<PSMmetaclass>>. In the earlier releases of AndroMDA, you write the PSM metaclasses by hand or generate them using the stereotype <<ValueObject>> which is somewhat crude.