[fpc-pascal] Generating code form xmi files
Michael Van Canneyt
michael at freepascal.org
Fri Apr 3 12:59:08 CEST 2009
On Fri, 3 Apr 2009, Mattias Gärtner wrote:
> Zitat von Michael Van Canneyt <michael at freepascal.org>:
> > On Fri, 3 Apr 2009, Graeme Geldenhuys wrote:
> > > On Thu, Apr 2, 2009 at 10:05 PM, Philippe Martinole
> > > <philippe.martinole at teleauto.org> wrote:
> > > >
> > > > xmi files (not xml) are used to save uml models :
> > > > http://en.wikipedia.org/wiki/XML_Metadata_Interchange
> > > > and I want to gererate my data structures from my uml diagrams
> > > > I would be suprised if nothing already exists
> > >
> > > I've been looking for something like this for a long time and haven't
> > > fond anything for Free Pascal / Lazarus. You can obviously use Model
> > > Maker and simply tweak the generated object pascal code to make sure
> > > they are compilable with FPC. But I believe Model Maker is quite
> > > pricey.
> > Well, Umbrello (Open source, comes with KDE) can generate code from XMI
> > for various languages (C,C++,PHP, Java) except pascal. All you need to
> > do is write an output engine for pascal.
> > It is on my todo list, item no. 132.458 :-)
> I just tested Umbrello and I got the impression it is very C++-centric - the
> dialogs, the options, the code. For example I don't see how to setup free
> pascal properties - it seems to have only basic variables as attributes.
> Is this a shortcoming of UML in general?
No, I don't think so; But the 'pascal' implementation is very rudimentary,
for instance there is no 'published' visibility. if you look at the
language specific options, you'll see that the pascal language has no
options yet. I would expect that one could put some pascal-specific
I expect it'll be up to us to provide this :(
I use umbrello extensively for the diagrams till now,
it would of course be nice to have it import/export pascal code as well.
So, it remains on my todo list. But maybe if interest is raised enough,
someone with more time/pressing needs will do it before me :-)
More information about the fpc-pascal