Chapter 8 Working with Object-Oriented Models


Generating Other Models from an OOM

You can generate the following types of models from an OOM:

Steps To generate a model from an OOM:

  1. Select Tools, and then one of the following to open the appropriate Model Generation Options Window:

  2. On the General tab, select a radio button to generate a new or update an existing model, and complete the appropriate options.
  3. [optional] Click the Detail tab and set any appropriate options. We recommend that you select the Check model checkbox to check the model for errors and warnings before generation.
  4. [optional] Click the Target Models tab and specify the target models for any generated shortcuts.
  5. [optional] Click the Selection tab and select or deselect objects to generate.
  6. Click OK to begin generation.

Note   Generation options
For detailed information about the options available on the various tabs of the Generation window, see the Linking and Synchronizing Models chapter of the Core Features Guide .

The following table details how OOM objects are generated to other models:

OOM CDM PDM XSM
Domain Domain Domain Simple Type
Class (Persistent and Generate check boxes selected) Entity Table Element
Abstract class Entity Table Complex type
Attribute (Persistent check box selected) Attribute Column Attribute or element (see generation options)
Identifier Identifier Identifier Key
Composition - - New level in the element hierarchy
Operation with <<storedProcedure>> stereotype (parent class generated as a table) - Stored procedure attached to the table, with the operation body as a body in the procedure definition. -
Operation with <<storedFunction>> stereotype (parent class generated as a table) - Stored function attached to the table, with the operation body as a body in the function definition. -
Association Relationship or association Reference or table KeyRef constraints
Association class Entity/relationship notation: entity with two associations.

Merise notation: association, and two association links
A table and two associations between the end points of the association class -
Dependency - - -
Realization - - -
Generalization Inheritance Reference Complex type derivation (XSD) or attribute migration to child element (DTD)

Generating from classes

For a class to become a table you need to select the Persistent check box and define a type of generation in the Generation list in the Detail tab of the class property sheet.

The cardinality of a class becomes the number of records of a table.

Generating from associations

If the association has a many-to-many multiplicity: both roles of the association have the * sign selected in their multiplicity lists, the association is translated into a table in the generated PDM. If it has any other multiplicity, the association becomes a reference.

A role name becomes a migrated foreign key after PDM generation.

 


Copyright (C) 2008. Sybase Inc. All rights reserved.