Samples Tutorial

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Modeling Data Services

Any data service — physical or logical — can be placed in a model diagram. Model diagrams show:

The main purpose of the diagram is to help you envision meaningful subsets of the model, but it can also be used to define new artifacts or edit existing artifacts.

 


Objectives

After completing this lesson, you will be able to:

 


Overview

Model diagrams show how various data services are related. Models can represent physical data services, logical data services, or a combination.

Each physical model entity represents a single data source. In the case of relational sources, you can automatically generate physical models that are representative of data sources. After being generated, physical data services can be integrated with other physical or logical sources in the same or new models. Physical model types use a key icon to identify primary keys.

Logical data model entities, which are discussed in detail in the Data Service Developer's Guide, represent composite views of physical and/or logical models.

Within the model diagram, data services appear as boxes. Relationships are represented by annotated lines between two data services. Each side of the relationship line represents the role played by the nearest data service. The annotations for each relationship include the following:

A data service's navigation functions determine the relationship's cardinality and directionality. Arrowheads indicate possible navigation paths.

ALDSP model diagrams are very flexible; they can be based on existing data services (and corresponding underlying data sources), planned data services, or a combination. Using models you can easily manage multiple data services as well as identify needs for new data services. You can also create and modify data service types directly in the modeler and inspect data services.

Figure 5-1 Model Diagram for Physical Data Services

Model Diagram for Physical Data Services

 


5.1 Creating a Basic Model Diagram for Physical Data Services

Modeling data services begins by adding individual data services to a diagram.

Objectives

In this exercise, you will:

Instructions

  1. Create a new folder in the DataServices project and name it Models.
  2. Create a new folder in the Models folder and name it Physical.
  3. Create a blank model diagram, by completing the following steps:
    1. Right-click the Physical folder.
    2. Choose New Arrow symbol Model Diagram.
    3. Select Data Service Arrow symbol Model Diagram as shown in Figure 5-2.
    4. Figure 5-2 Create Model Diagram


      Create Model Diagram

    5. Enter ApparelDB_Physical_Model in the File name field.
    6. Click Create. A blank workspace opens. You can use that workspace to construct your model diagram.
  4. Add the ApparelDB and CustomerDB physical data services to the model by dragging and dropping the following data service files from the Application pane into the model:
    Data Service File
    Location
    CUSTOMER_ORDER.ds
    DataServices\ApparelDB
    CUSTOMER_ORDER-LINE_ITEM.ds
    DataServices\ApparelDB
    PRODUCT.ds
    DataServices\ApparelDB
    ADDRESS.ds
    DataServices\CustomerDB
    CREDIT_CARD.ds
    DataServices\CustomerDB
    CUSTOMER.ds
    DataServices\CustomerDB
  5. Notice that relationships between some data services already exist. These relationships were automatically generated during the Import Source Metadata process, and are based on the foreign key relationships defined in the underlying database.

    Figure 5-3 Physcial Data Services Model Diagram


    Physcial Data Services Model Diagram

 


5.2 Modeling Relationships Between Physical Data Sources

The next step in data service modeling is to define additional relationships, beyond any relationship that was automatically generated during the import source metadata process.

A relationship is a logical connection between two data services, such as the CUSTOMER and CUSTOMER_ORDER data services. A relationship exists when one data service retrieves data from another, by invoking one or more of the other data service's functions.

Objectives

In this exercise, you will:

Instructions

  1. Drag and drop the top-level CUSTOMER element onto the top-level CUSTOMER_ORDER element. The Relationship Properties dialog box opens.
  2. In the Relationship Properties dialog box, modify the cardinality properties of the CUSTOMER and CUSTOMER_ORDER data services, by completing the following steps for the CUSTOMER node:
    1. Select 0 from the Min occurs drop-down list.
    2. Select n from the Max occurs drop-down list.
    3. The relationship cardinality is now "1:0 or many" between the CUSTOMER and CUSTOMER_ORDER data services. In other words, one customer can have none, one, or any number of orders.

  3. Click Finish.
Note: In subsequent lessons, you will use additional features of the Relationship Properties dialog box to customize relationship properties.
Figure 5-4 Relationship Properties -- Cardinality

Relationship Properties -- Cardinality

Note: It may take a few seconds to generate the relationship line.
Figure 5-5 New Relationship Between Customer and Customer_Order Data Services Defined

New Relationship Between Customer and Customer_Order Data Services Defined

  1. Save all your files using the File Arrow symbol Save All command.
  2. Open CUSTOMER.ds in Design View. The file is located in the DataServices\CustomerDB folder.
  3. Confirm that the CUSTOMER data service includes a new relationship with the CUSTOMER_ORDER data service, using the getCustomer_Order() function.
  4. Figure 5-6 CUSTOMER Data Service Showing Added Relationship Function


    CUSTOMER Data Service Showing Added Relationship Function

  5. Open CUSTOMER_ORDER.ds in Design View. The file is located in DataServices\ApparelDB.
  6. Confirm that the CUSTOMER_ORDER data service includes a new relationship with the CUSTOMER data service, using the getCustomer() function.
  7. Figure 5-7 CUSTOMER_ORDER Data Service Showing Added Relationship Function


    CUSTOMER_ORDER Data Service Showing Added Relationship Function

  8. (Optional) Create a relationship between CUSTOMER and CREDIT_CARD data services.
  9. (Optional) Close all open files.

 


Lesson Summary

In this lesson, you learned how to:


  Back to Top       Previous  Next