hello people,
first of all, if you respond to this message, please do a reply-all (I have a problem sending emails from my usual account, reading is fine)..thanks!
I am writing a validator for the new struts cartridge, it will automatically check the validity of the modeled application for use with the cartridge and if there would be any issues it will say so with errors and warnings. This can come in pretty handy.
Anyway, this is not specific to this cartridge only, but it is interesting for all cartridges to have some validation. There was an email about this subject some days ago, and it seemed people have already been thinking of extending the UML API interfaces.
Bottom line, we need some common interfaces for the cartridges to implement. My idea was to use the well known Visitor pattern, using double-dispatching it allows very flexible features to be added to existing data-structures such as the UML model from which AndroMDA generates code. (I have always been keeping Tony's excellent idea in mind, where you build a domain specific sub-model from the UML model and work with that in your cartridge, this ould benefit a lot from that I think)
Concretely I was thinking of these interfaces in the andromda core:
AndromdaModelVisitor, marker interface (no methods)
AndromdaModelTreeNode, interface with only 1 method: public Object accept(AndromdaModelVisitor visitor);
The Struts cartridge (for example) would then have these interfaces/classes
StrutsModelVisitor, this interface extends AndromdaModelVisitor (has a visit(...) method for each concrete node)
StrutsModelValidator, this class implements StrutsModelVisitor for validation of each node
StrutsModelNode, this abstract class extends DefaultMutableTreeNode implements AndromdaModelTreeNode
and then a concrete node class for each possible node, extending StrutsModelNode
But you could do in the cartridge whatever you want of course.
So, would it be okay if I put those 2 interfaces "AndromdaModelVisitor" and "AndromdaModelTreeNode" in the andromda-core package ?
If yes, which is the package of preference ? any ideas ?
If no, are there any interesting alternatives ?
thanks for your feedback
Wouter.
