A simple Model driven architecture (MDA) approach
Created: 04-Mar-2004
Document
purpose: to create a simple application wireframe generator
starting with an UML model.
The
approach:
The
tools:
– UML
based generator (the Andromda
tool): it is a velocity based generator. Based on UML model elements
including stereotypes and taggedvalues the result is generated.
I had to write a number of templates for the mappings and the tapestry
pages.
– O/R
mapper (Hibernate): used for
database operations
– Web
components (Tapestry):
used for the interface. The component based approach which makes
easy to combine different components into creating the interface.
Model
constraints:
The
generation is based on the following constraints added to the model
elements:
StereoTypes:
– Entity
(generate stuff for this class)
– specialField (ignore attribute in generation)
– primaryKey (this field is a primary key)
– {none} (generate as attribute)
– TapestryApp (at least one entity must have this stereotype to
generate auto.application files and menu entries).
Observation:
to integrate generated and non-generated parts of the application
I used the XML include functionality: <!ENTITY
gpages SYSTEM “auto/autopages.application”> makes possible
to insert the content of the autopages.application file later using
the &gpages; syntax.
TaggedValues
(for attributes):
– SQLType
– fieldHint:long (generate TextArea for this String attribute)
– fieldHint:email (use and email validator for this String attribute)
– NotNull:the attribute is not null (applicable for textArea and
DatePicker too)
– editable:false (do not generate code for modification of this
attribute)
– detail:true (do not create a column for this attribute in the
list, show only in the detail page)
(for
class)
– search: true (generate a <span @{class.name}Search>. This
makes easy to insert custom search components)
(for
satellite entities)
– masterName: name of master (client)
– masterClass: class of master (ro…data.client)
– masterLabel: use it to name the master (defaults to name). This
is an OGNL expression used to obtain a label for an object based
on it’s id.
Generated
stuff :
– hibernate
2 mapping files
– .java,
.page, .html files for displaying a list of entities, adding an
entity, modifying an entity, showing details of an entity.
– relation
support (navigation between entities). This include satellite support
(one entity which has no meaning without another)
Missing:
– multi-to-multi
relations when the number of entities is large (does not fit inside
a palette component)
– entities
which are satellite for multiple entities.
– a
lot of many other things :(
Comments:
escorts kamloops -
Just try to smile… for about 2-3 mins then you can get back to work…