ObjectExtender User's Guide and Reference

Defining the model with the Model Browser

In brief, use the Model Browser to define your object model. Your object model is a collection of business objects represented in terms of classes and associations. Once defined, the persistence support for your model is created by using code generation services.

To create a new object model, first determine the business objects in your model that will persist to the data store, then create the classes and associations that will represent your business objects.

Creating models. To create a model:

  1. Launch the Model Browser.
  2. Select New Model from the Models menu.
  3. Name the model.
  4. Click OK.

Creating classes. Continue defining the model by creating the classes and associations that represent the business objects for the model. To create a class:

  1. In the Models view, select the model name.
  2. From the Classes menu, select New Class. This launches the Class Editor.
  3. Provide a unique name for the class. Make sure that the name is unique not only for your model but also for the classes loaded in your image.
  4. Next, define attributes for the class:
    1. In the Attributes tabbed dialog box, click New. This launches the Attribute Editor.
    2. Provide an attribute name.
    3. Select an attribute type.
    4. Click Value required. This indicates whether your model requires a value for this attribute or not.
    5. In the Attribute Editor, click OK.
  5. Define the object identifier by selecting one or more of the defined attributes and moving them to the Object ID view. To move an attribute in this view, click on the double arrow (>>).
  6. In theClass Editor, click OK.

Creating associations. To create an association between two classes:

  1. From the Associations menu, select New Association.
  2. Provide an association name.
  3. Select two classes in the model that will have an association.
  4. Each class will play a role for the other class. For each class, do the following:
    1. Type a name for the role that the class will perform for the other class.
    2. Specify whether the role is navigable from the other class in the association.
    3. Specify the cardinality of the role. Cardinality is expressed by specifying the Many, and Required choices in some combination.

Generating business objects. After you have completed the model description, generate the domain classes using the code generation services.

What the code generation services create. The generation of the model will produce the following:

Once the business object classes are generated, you can create transactional instances of the classes and manipulate them and their relationships in transactions. Refer to Managing business objects.

Saving models. Save your model definition to an application and storage class that you supply. Saving your model enables you to take advantage of the existing library management functions. These functions are the same ones you use when sharing code with other developers such as versioning, releasing, and loading different editions of an application.

Suggestion: A useful naming convention is to name your application as follows: XYZMetadataApp where the XYZ is some prefix you choose. Use this application to store a model, schema, and map for a given application.

Recommendation:Save the model definition to an application different from the generated model calsses. The model will generate into any previously generated schema that has the same name as the one it would have created. For existing columns, it does not modify information such as field type or length. If attributes or roles are deleted, the previously generated columns are not dropped and this is managed by the user.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]