Dictionary

The Dictionary represents a relational-model of the project being generated.

The Dictionary has the following components:-

The Dictionary is not dependent on JGenerator, and exists as a stand-alone set of classes in the com.javelin.generator.dictionary package. The Dictionary classes use the JBean component model. The Dictionary contains a rich set of meta data that has been designed to make code generation simple. Because every class is based on the JBeans components supplementary information can be added as additional name-value pairs.

Entity-Relationship Diagram

The diagram below illustrates the model of the Dictionary.

 

The relationships between the classes in the Dictionary are fairly complete. As a rule every class in the database can be added and removed from its parent class, and a parent can be set on the child. The code handles any circular addition or removal in the parent child relationship. Child classes can be found using an index, an enumeration or a name.

All the classes have a rich set of meta-data that has been used to code generate many complex projects.

Classes

Simply every table shown in the E-R Diagram above is an interface, and is implemented by a class of the same name, but appended with the word Bean (i.e. the interface Server has a server ServerBean interface). This is done to separate the interface from the implementation. It also makes compilation less of an issue as the classes only refer to each others interfaces which are a lot less likely to have compilation problems.

Validation

All the classes in the Dictionary can validate themselves. The validation methods will throw exceptions if any data is missing from the dictionary.

The validation process descends in the following order:-

  • Server
  • Database
  • Tables
  • Columns
  • Types
  • Indexes