UML Elements to EGL Transformation
The UML to EGL transformation recognizes a limited set of UML model elements to perform the transformation. The following list describes the recognized elements and the output generated during the transformation for the element.
- Package
- All UML packages result in the creation of an EGL package. The model itself is a package, so a top level package based on the name of the model is created. Additionally, if there are nested UML packages, each will cause an EGL package to be generated.
- Class
- A class in the UML model represents a database table. For each
class in the model, the following are created:
- EGL SqlRecord
- A table definition in the DDL created. This definition is located in the <project>/scripts/data/createTables.sql directory, where <project> is the location of the project.
- A library or service containing functions for performing create, read, update, and delete operations on the class.
- A search/list JSP and corresponding Pagehandler functions that provide search operations on the database table and view lists of results.
- A detail JSP and corresponding Pagehandler functions for displaying the details of a specific database row. Add, update, and delete operations can also be performed through the detail pages.
- Operation
- From each operation element a function stub in the data access library is generated and each operation parameter becomes an EGL parameter. An SqlRecord of the containing class's type is also passed as a parameter, in order to allow the operation to be performed on a specific instance of the SqlRecord.
- Attribute
- Each attribute element in the UML model represents a database
column. For each Attribute, the following is generated:
- An EGL SqlRecord Field
- A column definition in the DDL.A UML class must represent a normalized database table. If not, multiplicities greater than one are ignored.
- Association
- An association element represents the relationship between two
end classes. Associations with more that two end classes are ignored
during the transformation. The following is generated for an association:
- Foreign key definitions in the DDL.
- Columns inserted into the database tables representing the association ends.
The type of association affects the specifics for what is generated for an association element. There are three types of associations:- One-to-one associations
- Transformation of an one-to-one association results in the insertion of the key columns from one of the participating tables into the other table. Associated rows are accessible through the generated detail pages. Association end navigability determines whether the relationship is exposed in the detail JSPs.
- One-to-many associations
- Transformation of one-to-many associations results in the insertion of the key columns from the multiplicity one side into the table representing the multiplicity many side. Data access functions are generated to allow navigation of these associations. Exposure of the relationship within the detail JSP is determined by the navigability of the Association ends.
- Many-to-many associations
- Transformation of many-to-many associations result in the creation of an associative table and corresponding SqlRecord. The table's columns consist of the keys from the associated tables. Data access routines are generated to allow manipulation of the associative table. The relationship is exposed through the UI as determined by the navigable attributes of the associated classes.
- Enumeration
- The enumeration element defines the possible values for a data
type or property. For each enumeration element in the UML model, the
following EGL elements are generated:
- A library that contains the following:
- A constant integer value for each enumeration literal.
- If transforming from a UML model, you can specify the values for each enumeration literal.
- If transforming an existing database, the transformation creates a named integer and assigns it a value based on the ordinal position of the enumeration literal within the enumeration.
- A String array consisting of the names of the enumeration literals. This array is used to display enumerated values detail JSP. A selectOneMenu is used to allow users to select a value for the enumerated column.
- A constant integer value for each enumeration literal.
- An EGL DataItem of type INT that will be used as the field type in SqlRecords. Database columns based on enumeration types will be defined in the table as INTEGER.
- A library that contains the following: