Enterprise Components




Introductory Developers Guide

 

Background  

Cotsec is designed as a framework for allowing a large system to be developed very quickly, and in a manner that is comparatively platform-neutral.

Cotsec is driven by the "metadata-driven " pattern which suggests that if a development process is repeated frequently that it should be extracted out, expressed as meta-data with a program generator, and streamlined.

The generator framework the Cotsec has created is very flexible, supports template inheritancem and is designed to be highly flexible through the use of an XML generator definition file and templates.

Overview of generator operation

At it's most basic level, the generator framework takes a context containing variables and a template that references the variables and produces an output file. The framework is able to insert the generated file into other nominated files.

A context can be thought of as a variable table - it lists variables and their values by name. A template is a Velocity template that enables the user to insert variables from the context. For example a template might be "This is a short template - here's the name of the form: $classdata.name". $classdata refers to a variable in-context (.name is a getName() method within the ClassData object).

Generators

Generators have the responsibility of supplying information to Contexts and creating some form of output. Typically this output takes the form of a template with the Context information merged in. The standard generator will take the defined context information and generate a set of single files. It provides a very basic set of GeneratorInfo to the context factories, and is typically used to output multiple files from a set of input XML files. A graphical editor is used to generate the metadata files. The editor itself has been built with the Cotsec framework.

Template inheritance

Cotsec supports template inheritance - where a template that is common to multiple styles (see below), or one or more generators can be factored out in a similar manner to that of standard object oriented code.

Styles

Generators support the concept of "styles". A style is an ability to pick a different template for generation based on the generator-instructions style property, allowing the template definer to create a suite of different looks and feels for different sections of an application. Styles should not be used to target completely different environments, but to provide look and feel changes only. Common functionality to multiple styles can be factored out using template inheritance.

New language guide

A New Language Guide is availabe to help developers new to Cotsec port the framework to new languages or language frameworks. The guide covers the development of new generators, templates, controls and language-metadata - everything required to create a generator for a new language.

Thus far, previous experience has shown that creating basic new generators is typically the work of a few days for one person.

Cotsec API (Javadoc)

Cotsec provides Javadoc and will also provide source code to approved users. Please contact Cotsec for details.