[plt-scheme] Brainstorming about how to transform UML XMI into some code

From: Grant Rettke (grettke at acm.org)
Date: Sun Jun 10 13:06:59 EDT 2007

On 6/10/07, John Clements <clements at brinckerhoff.org> wrote:
>
>
> On Jun 10, 2007, at 9:41 AM, Grant Rettke wrote:
>
> Hi folks,
>
> Most good UML editors support the ability to export to XMI:
>
> http://en.wikipedia.org/wiki/XML_Metadata_Interchange
>
> Regardless of our take on the role of UML and its editors, I've got a
> question.
>
> We have been looking at a technology called OAW:
>
> http://www.openarchitectureware.org/
>
> It provides a pretty straightforward way to transform XMI into
> whatever you feel like generating. Using Eclipse it lets you write
> transformations in a little statically typed functional language. For
> example:
>
> <<DEFINE Root for data::DataModel>>
>    <<EXPAND Entity FOREACH entity>>
> <<ENDDEFINE>>
>
> This is awesome.  What do you use for the XMI metadata... triple brackets?

Those double brackets are actually guillemots (incidentally this is
the first time I've ever seen or heard of a guillemots). Inside of the
guillemots, your environment is that of the XMI "object"
representation. Within that environment you can write expressions that
"bind?" to features in that environment. OAW runs as an Eclipse plugin
so you can get code completion on the XMI data.

> That functions starts processing the model at the highest level and
> for each Entity it has inside of it, call the function Entity (for
> type Entity).
>
> How would one approach something like this in Scheme?
>
> Syntactic yuckiness aside, there's no shortage of work on the parallels
> between XML and XML transformations and s-expressions and s-exp
> transformations.  I would start by looking at Oleg Kiselyov's sxml
> representation of XML in s-expressions, and his work with others (including
> Shriram Krishnamurthi) on sxslt, a manipulation language for xml.  If this
> work does not directly apply, I suspect that minor alterations would yield
> something that is
>
> - substantially nicer than existing systems, and
> - totally unusable by people allergic to parentheses
>
> Would it be obvious to me if I read EOPL or SICP how one may approach
> this problem?
> Perhaps, yes.
>
> The fundamental insight is that creating Yet Another "little ... functional
> language" is a colossal waste of time; embed the language you want in an
> existing one that is reasonably extensible.  There might be something
> interesting in the "statically typed" part... or maybe not.

The SP part doesn't seem to matter, as we are only interested in the
names of attributes and the relationships between classes (and their
stereotypes).

The OAW guys are very nice folks. Their mission is to make model
driven software development possible for folks who are specifically
working with and generating Java.

Thanks for your thoughts on this. Considering that the OAW folks use a
little functional language to do the work, it seems like using Scheme
isn't too far "out there".


Posted on the users mailing list.