[Top] [Prev] [Next]

Application Model

The Entity-Relationship model isn't expressive enough to build an application so a more elaborate model, expressed using xml is used to add features to the model.

3.1 Model Options

To give some idea of the relationship between the model and the application artifacts, different models can be created using these options:
Employee table uses Identity column for Primary Key
Add Stored Procedure feature to Employee Entity
Add LOCKCOUNTER column to Employee table and add Lockcounter feature
The frame on the left shows an xml view of the model. The application artifacts will be generated by applying stylesheets to this model. The prototypes for the artifacts are a java Data Access Class (in the center frame) and Stored Procedures, if that feature is specified, that will be used (in the rightmost frame). The effects of changing an option are highlighted with coloured text.

3.2 Notes about the model

The xml model describes:

3.3 Model Elements

project
The project element is the root element for the model
table
The table element names a database table
column
The column element describes a column in a table
relationship
Describes the primary key column(s) and foreign key column(s) that link two tables
feature
feature elements describe something that application artifacts will implement. Features include:
Lockcounter
Columns with the Lockcounter feature will be used to provide optimistic record locking by incrementing the column each time it is updated, and only updating a row when it's column has the same value as when it was read.
Stored Procedure
Tables with the Stored Procedure feature will produce stored procedures to select, insert, update, and delete records.
Business Key Column
Denoting a column as a Business Key declares that the column is used to identify a row much like a Primary Key. But whereas a Primary Key is used to uniquely identify a record by a database (ex. an employee number), a Business Key is used to identify a record by a human being (ex. an employee name).