Achilles' Tortoise

"That beautiful First Proposition of Euclid!" the Tortoise murmured dreamily. "You admire Euclid?" "Passionately! So far, at least, as one can admire a treatise that won't be published for some centuries to come!"

Thursday, September 28, 2006

openarchitectureware

I have been using openarchitectureware for several months now and I am becoming a convert to MDA/MDE and code generation. Here are the basic steps I have taken to create a user interface tool using Eclipse:
  1. Created an Ecore (EMF) model that represented the UI meta-model. This model includes classes like "webapp", "page", "field", "checkbox", etc.
  2. Generated an EMF "GenModel" from the ecore. This is an automated step.
  3. Generated Java classes and an Eclipse editor for the model.
  4. Installed the editor into Eclipse. This default editor lets you edit your domain-specific model in a tree-view / property sheet kind of editor that you frequently see in Eclipse.
  5. Created a domain-specific model to represent a sample application. Create some pages, insert some sections, fields, buttons, etc. (All these things are classes in the meta-model).
So far so good? Everything I have described to this point is basic Eclipse with EMF. Now enters openarchitecureware (OAW):

OAW introduces the concept of a "workflow", which is an XML doc that describes the steps to be taken in the workflow. A basic workflow is:
  1. Parse the model XML using an OAW-supplied XmiReader.
  2. Run a Check that incorporates custom validation of the model.
  3. Run code generation using the OAW-supplied "Xpand2" template language.
  4. Enjoy fruits of labor.
Before you can complete step 4, however, you must write the code generation macros in the Xpand2 language. Xpand2 is a very powerful template language that can produce pretty much any textual output (e.g. Java source code, XML, HTML, Javascript, etc., etc. ) Xpand2 supports polymorphism in that you may supply macros for a type and then overload the macro for subtypes. Quite powerful and very enjoyable to work with.

As a further note, EMF is not the only form of meta-model that OAW can operate on- it also supports a Java Bean model, but I have only used EMF.

as the wheel turns...

"So," said Achilles, "I have had lots of great ideas for software, but every time I develop it, the technology goes stale. Like that great Powerbuilder app I wrote back in the 90s. I'm getting tired of the march of technology... Now everyone wants things written in Ajax, or Ruby...". Achilles sighed and leaned his head back on the tortoise's carapace.

"That is because you hide your idea within the implementation. Consider capturing your idea in a timeless form that can be used again and again." replied the tortoise...

From Wikipedia:

"What the Tortoise Said to Achilles" is a brief dialogue by Lewis Carroll which playfully problematises the foundations of logic. The dialogue alludes to one of Zeno's paradoxes of motion, in which Achilles could never overtake the tortoise in a race. In Lewis's dialogue, the tortoise challenges Achilles to use the force of logic to make him accept the conclusion of a simple deductive argument. Ultimately, Achilles fails, because the clever tortoise leads him into an infinite regression.