Book a Demo

Author Topic: Code generation by package  (Read 3035 times)

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Code generation by package
« on: July 28, 2012, 11:33:11 pm »
Does anyone know of a way to put all of the generated code for a package into a single file? I have a situation where I need to generate an XML-based language description, but it requires all of the classes for a given model in one file.

Right now, the only thing I can think of would be to do a model transform that creates a class for the package and inner-classes for the real classes. But I'm not sure if that can be done either :-)

BTW, this looks like it is supported for XSD and DDL generation, but they don't use the standard code-generation mechanism for those, which leads me to believe that what I want to do is not possible.

~Bill

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Code generation by package
« Reply #1 on: July 29, 2012, 09:00:54 pm »
I once did a similar thing, but for a new languages profile. At least I found no better way as creating another pseudo package stereotype that uses the class metatype. All other stereotyped classes of this profile are to be placed as embedded classes there.
In general this approach works well, I'm also using the pseudo package type to specify additional per file options as tagged values. It has some disadvantages though, e.g. no individual package control is possible for the pseudo packages.

HTH
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/