Book a Demo

Author Topic: Discussion: Full restructuring of default MDA  (Read 2982 times)

danm

  • EA User
  • **
  • Posts: 88
  • Karma: +0/-0
    • View Profile
Discussion: Full restructuring of default MDA
« on: December 08, 2007, 07:48:56 am »
Hello,
  I'm implementing the MDA transform support for associations according to the following excellent article

http://www.devx.com/enterprise/Article/28528

Now it's simple enough to put this into an MDA xfrm for say, C#, then generate code in the corresponding code template. The templates are quite powerful as it turns out so this is not too hard (once you figure out how to do it!)

But I work in several languages, I'd hate to go into all of them and add the same association transform templates. This way of handling associations is really independent of the language. Why not simply create a new template - like "Association Template" which is used in a transformation chain?

So the MDA process would be

Code: [Select]
PIM-->AssocTemplate-->PIM1-->C#Template-->PSM-->C# Code Template-->Code

The C# Template is still needed, at least to set the code gen language in the packages. It probably should otherwise be a direct copy, and shouldn't generate properties (for example) for link attributes (as that has been handled already) More complicated, but cleaner, and now all the common stuff is handled in one place.

Thoughts? I keep going back and forth. With this method the language specific template does very little, which bothers me. OTOH, this brings up the thought that maybe then the default code templates do too much. For example they create constructors/destructors. Seems like that could be moved up to the Language templates, which justifies their existence more. For example



  • AssocMDATemplate - creates functions necessary for associations et. al.
  • LanguageMDATemplate - also creates language specific operations and attribs, such as constructors/destructors, and fills out collection classes ...
  • CodeGenTemplates - These now are much simpler and just do a dumb generation of syntax.


Understandably Sparx has defaults which get you going, but it seems worthwhile to do a full restructuring of them to really harness the power of MDA. Ideas?

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Discussion: Full restructuring of default MDA
« Reply #1 on: December 09, 2007, 09:49:05 am »
My understanding is that the notion of multiple layers of transform in which the output of one layer is the input for another layer which adds more specificity and concreteness is very much a part of the MDA concept.  I suppose that many people only do a one level transform because they create models which are pretty closely tied to the expected language and platform so a single transform is sufficient.  But, if you want to start with a CIM and you want to include the ability to do things like switch UI as well as implementation language and other architectural decisions, then you pretty much have to go multi-level.