JeeWiz Home  
The Model-Driven System Builder

JeeWiz Architect's Guide
 
Contents  >   7.  Finding Values and Files
 


7.1 The Build Process

The following sections refer to the diagram below, which is followed by a short description.

The diagram shows the various objects and properties present during the Ant build of an EJB Jar. This particular case has the most complete set of objects where properties can be found. Other cases are discussed where there are fewer objects present.

  1. The overall build is started, external to JeeWiz This is normally the build.xml in the project - this is the first Ant 'object' in the top left-hand corner. This links to the jeewiz/bin/jwrun.xml build file, represented by the box below. These are regular Ant projects.
  2. The JeeWiz project is started as a separate executable running the build file
    jeewiz/bin/jwbuild.xml
    using the specialised 'jeewiz' Ant task; this is the third box in the 'Ant' column.

    All the properties created during the 'start-of-day' configuration process are read into this project.
  3. JeeWiz reads the XML specifications for the system, instantiating appropriate Java model objects to represent the specification. After each object is created, the component.properties file is read to calculate additional properties for this model object. 'component.properties' is covered in detail in the next section. Furthermore, patterns will also set properties on model objects.

    These three sources of properties are processed the same way. If there is a property defined on the meta-class (or one of its parents), the property is set by calling the setter. Otherwise, the property is put into a 'properties' HashMap; every model object has a properties HashMap.
  4. JeeWiz walks through the specification, invoking Ant build jobs on each object for which they are available. The build jobs are processed from the bottom up, so constraint objects are processed before parameters, say, and parameters are processed before methods. There are two fixed names for the build jobs that are run for each object (if they exist): uptodate.xml and build.xml. The end of this process is when the top-most model object, corresponding to the root element from the specification, has been built.

    In the diagram, the current Ant project is associated with the EJB Jar model object. All the other model objects that have build.xml files will also have their respective build jobs run, but not simultaneously. This is why only the one per-model object build.xml is shown. As the build.xml files are being processed, the model object tree is present and available.
  5. Although the per-model object Ant build can invoke any Ant task, there is a special task ('<jwVelocity') that processes Velocity templates. JeeWiz creates a per-template Velocity context, for storing local variables, using the current model object and its parents as additional locations for properties. By using navigation facilities, the EjbJar templates can access parents and children of the meta-model object.

    The same technique - a local Velocity context giving access to the model object tree - is used for processing patterns (model-to-model transforms) as well.
The following sections describe this process in detail, and explain the numbers.

 


Copyright (c) 2001-2008 New Technology/enterprise Ltd.