Graphviz September 29, 2006
Posted by steve in Graphviz.1 comment so far
Have you ever had a problem that you felt you could solve if only you could get a sense of the ‘big picture’? Ever needed help visualizing some complex relationships? How about a simple, free, open-source graphing application that produces highly-customizable output? Well, you should give Graphviz a try.
Suppose you would like to visualize the following relationships:
X -> Y;
Y -> Z;
X -> Z;
( I know this is trivial, but use your imagination). The above is almost exactly the input to Graphviz. Simply wrap the above into a ‘digraph’ structure and save it in a text file:
digraph G {
x -> y;
y -> z;
x -> z;
}
Running Graphviz and choosing the ‘dot’ layout engine results in this:
Pretty cool, don’t you think? Graphviz was developed by AT&T Labs and has a wide variety of uses. If you just need a quick visualization, you can do something like I have shown above. But if you want to ‘tweak’ the output a little more (like adding boxes, grouping nodes, labeling edges, etc), Graphviz can accomodate you. Check out the Graphviz web site for examples of some of the more sophisticated graphs you can create. There is also a sub-project called “Grappa” that is a Java package for Graphviz. There are Windows, Linux, OS/X and other OS executables available, or you can build your own using the source.
Echo2, GWT, et al. September 29, 2006
Posted by steve in echo2.add a comment
I describe in the openarchitectureware post about how I generate code from a model. This process is better and more completely described in the OAW 4.1 EMF Tutorial. Onward to what I have generated:
As a reminder, I created a meta-model that represented a web-based user interface. The model is basically a set of containers:
Scenarios contain Pages. Pages contain Sections. Sections can contain other sections
or Widgets. Widgets can be output text, input fields, menus, calendars, links to other pages, etc.
So, my first workflow creates a Java Server Faces (JSF) application. The macros generate all JSP files and all pagecode Java files. The web.xml and faces-config.xml files are also generated, including the navigation rules between the pages.
My second workflow creates HTML documentation and a input file to graphviz (which is a great free tool from AT&T for quick-and-easy graphing and I highly recommend you play with it). <blogPost topic=”graphviz” todo=”true”/>
After much work on the JSF workflow (due to the requirement to produce a real working application), I have now moved on to an evaluation phase. I am looking at more Ajaxy/Web 2.0-type applications. (aknowledging that you can do Ajax with JSF).
My third workflow creates an Echo2 application. Echo2 is an excellent framework from NextApp. Tod Liebeck, the lead developer of Echo2, has an interesting article comparing GWT and Echo2 on theserverside.com. In order to generate the Echo2 code, I made the assumption that a “Page” model class mapped to a WindowPane in the Echo2 framework. The result is a MDI (multiple document interface) application, where there is a menu bar along the top of the page and the various ‘pages’ popup as movable/resizable windows. I am currently working on producing a single-document interface page that will give people something to compare with the MDI approach.
I think the MDI interface is somewhat dated looking, although many modern desktop applications work this way.
After I complete the SDI look, I will move to developing a GWT implementation workflow.
openarchitectureware September 29, 2006
Posted by steve in EMF, Eclipse, MDE, OAW.1 comment so far
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:
- Created an Ecore (EMF) model that represented the UI meta-model. This model includes classes like “webapp”, “page”, “field”, “checkbox”, etc.
- Generated an EMF “GenModel” from the ecore. This is an automated step.
- Generated Java classes and an Eclipse editor for the model. Again, a right-click and “generate all” – no extra effort.
- 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.
- Created a domain-specific model (using cool new editor) 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:
- Parse the model XML using an OAW-supplied XmiReader.
- Run a Check that incorporates custom validation of the model.
- Run code generation using the OAW-supplied “Xpand2″ template language.
- 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. OAW also supplies a language called Check that can be used for validation and Xtend that can be used to integrate with Java when you need custom logic that you cannot write in Xpand2.
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… September 29, 2006
Posted by steve in Uncategorized.1 comment so far
“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,” replied the tortoise, ”is because you hide your ideas within the implementation. Consider capturing your idea in a timeless form that can be used again and again.”
What the Tortoise Said to Achilles September 29, 2006
Posted by steve in Uncategorized.add a comment
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.