Wednesday, July 30, 2008

model driven web app demo

In this demo I show how you might use Gem to create a model driven web application. I think it would be interesting to investigate pairing this with OSGi running on Amazon EC2.




Update:

I first described how the UriLayer/SegmentLayer worked back in January. Since then the details have changed a bit. The key points are described below:
  • URI segment names can be established by using a word prefixed with ~ at the beginning of a group. So [~foo a b c] causes the segment name of the group to be foo. The change from January is that it was foo~ (suffix instead of prefix) back then. Arguably, /foo or foo/ would be a clearer way of indicating segment name.
  • In the demo I forgot to talk about the '!' character. This is used to indicate the point at which you move from the filesystem into the model (in EMF terms, it's perhaps like going from the EResource to one of the logical elements - like an EPackage - inside the resource).
  • To continue with the last point
    • /demo/site.gem identifies a model file (or just some arbitrary file).
    • /demo/site.gem! identifies the Model element (the root node in the model).
    • /demo/site.gem!/ identifies the Figure inside the Model.
    • /demo/site.gem!/foo identifies a Site with segment name 'foo' inside the root Figure.
    • /demo/site.gem!/foo/ identifies the Figure inside the above Site.
  • So note from above that the trailing / always indicates a Figure (whereas in January it always indicate a Site).

Monday, July 28, 2008

Using Gem as a simple presentation engine

This demo shows how Gem can be used to create simple presentations.

Walkthrough of implementing a Gem layer

Demo part 1:


Demo part 2:

Sunday, July 27, 2008

Demo of new visual layers

Since the first series of posts in January I've been slowly working on a new set of layers that comprise a simple visual editor for Gem models. Here is a first look at the new stuff:



I talk about several layers in the demo. Here is a quick summary of them:
  • FrameLayer - Manages size and position information of visual elements. Supports mapping raw coordinates to the "most appropriate" (deepest) element.
  • ShapeLayer - Performs layout and drawing of the view. Can be extended to support a variety of layout and draw methods.
  • SelectionLayer - Keeps track of the currently selected element. (Forgot to mention this in the demo.)
  • MouseEventLayer - Handles raw mouse events received by the SWT canvas and forwards them to the most appropriate ShapeFacet for handling.
  • KeyEventLayer - Handles raw key events and directs them using the current SelectionFacet.
  • GraphvizLayers - Render sections of the model as "interesting" graphs using graphviz.