Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
43
Добавлен:
16.04.2013
Размер:
3.34 Mб
Скачать

C H A P T E R 9

0DQDJLQJ 2EMHFW 5HSOLFDWLRQV

About this chapter

This chapter describes the use of object replications in PowerDesigner.

Contents

7RSLF

3DJH

 

 

Defining object replications

336

 

Displaying replications

350

 

Working with object replications

352

General Features Guide

 

'HILQLQJ REMHFW UHSOLFDWLRQV

'HILQLQJ REMHFW UHSOLFDWLRQV

 

PowerDesigner lets you copy objects among different models while

 

preserving the link to their target object.

6WDWLQJ WKH SUREOHP

Access to target

When a shortcut references an object in different models, the complete object

object problem

definition can only be accessed when the referencing model is opened.

 

When the referencing model is closed, the shortcut that references the target

 

object only contains a partial definition (name, code, type) of the target

 

object.

 

Some attributes of an object are critical to the operation of PowerDesigner,

 

thus making shortcut usage impractical. For example shortcuts to CDM data

 

items are not allowed because the data type attribute is not available to the

 

model if the referencing model is closed.

 

Another example can be the reuse of a table structure in your application that

 

comes from a corporate department or division. You may have a copy of this

 

table in your database application with some database replication

 

mechanisms. In that case, a replica would be more useful than a shortcut, as

 

you have the full table structure and do not need to open the target model to

 

generate a complete and correct SQL. It is even more obvious, if you add

 

columns to your copy of the table.

Local changes

When a shortcut references an object in different models or packages, you

problem

cannot perform changes on these shortcuts. Only the target object can be

 

modified.

This can be restrictive when for example a Client table that you referenced in different models or packages contains more columns that you need (Name, Address, Phone Number, Fax number etc.). In one model you may need that Client table with only the Name and Address columns, and in another model you may need the same table with only the Name column, but want to preserve the link to the target object nevertheless.

PowerDesigner addresses these needs with the REMHFW UHSOLFDWLRQ feature.

For more information on shortcuts, see chapter Managing Shortcuts.

 

PowerDesigner

&KDSWHU 0DQDJLQJ 2EMHFW 5HSOLFDWLRQV

8QGHUVWDQGLQJ WKH REMHFW UHSOLFDWLRQ FRQFHSW

 

In PowerDesigner you can reuse the definition of an object among several

 

models by replicating the object in the same model or in different models.

 

When you replicate an object, you perform a UHSOLFDWLRQ that consists in

 

creating a local copy called UHSOLFD of the RULJLQDO REMHFW while preserving

 

the link to it in order to automatically update the replica when the original

 

object is modified.

 

An object replication is the ability to make an exact copy of an object and

 

update this copy when the original object is modified. Attribute changes on

 

an original object are automatically propagated to the object replica.

 

When you replicate an object, all its attributes are by default synchronized in

 

the replica and appear as read-only in the replica property sheet. You can

 

desynchronize some attributes using the Version Info page of the replica

 

property sheet or using the replication property sheet if you want to perform a

 

partial replication of the original object attributes and thus diverge from the

 

original object.

 

For more information on how to desynchronize attributes using the

 

Version Info page of the replica property sheet, see section Desynchronizing

 

replicated attributes, replicated collections and sub-replications.

 

Using object replications means you do not have to duplicate objects. The

 

replica uses the name, code, type and Id of the target object and is

 

automatically updated when the definition of the target object is modified.

Replica

A UHSOLFD is a copy of an original object or target object. The replica

 

references its original object in the same or in different models or packages.

 

It owns a read-only list of synchronized attributes with those of the original

 

object.

Referencing model

A UHIHUHQFLQJ PRGHO or SDFNDJH is where the replica is created.

Original object

An RULJLQDO REMHFW is a target object that has one or more replicas in the same

 

or in different models or packages.

Replication

A UHSOLFDWLRQ materializes the link between the replica and the original

 

object. It has no symbol in the interface but does have a property sheet from

 

which you can desynchronize replicated attributes and collections.

 

If you need to access the definition of a target object when it is referenced in

 

different models, you will choose to perform an object replication and create

 

a replica that will be an exact copy of the original object.

General Features Guide

 

'HILQLQJ REMHFW UHSOLFDWLRQV

This local copy reuses the definition of the original object, you can access its properties even when the model that contains the original object is closed:

If you need to perform local changes on an object that references another object within the same or another model, you will choose to perform an object replication and create a replica that will allow you to diverge from the original objects attributes and customize the replica attributes according to your needs using the replication property sheet:

For more information on how to desynchronize attributes, see section Desynchronizing replicated attributes, replicated collections and subreplications.

 

PowerDesigner

 

 

&KDSWHU 0DQDJLQJ 2EMHFW 5HSOLFDWLRQV

 

 

 

 

 

 

 

Which objects

You can create as many replicas as you want for most of the object types that

 

support object

appear under a model diagram or package in the Browser tree view.

 

replications?

You can also create replicas of replicas.

 

 

 

 

 

 

 

 

The following table lists objects per module that support replications:

 

 

0RGXOH

 

'LDJUDP

 

2EMHFW

 

 

 

 

 

 

CDM (Conceptual Data Model)

 

 

Entity

 

 

 

 

 

 

Data Item

 

 

PDM (Physical Data Model)

 

Physical

 

Table

 

 

 

 

 

 

 

 

 

 

View

 

 

 

 

 

 

User

 

 

 

 

 

 

Role

 

 

 

 

 

 

Group

 

 

 

 

 

 

Abstract Data Type

 

 

 

 

 

 

Test Data Profile

 

 

 

 

 

 

Storage

 

 

 

 

 

 

Tablespace

 

 

 

 

 

 

Procedure

 

 

 

 

 

 

Trigger Template

 

 

 

 

 

 

Trigger Template Item

 

 

 

 

 

 

Join Index

 

 

 

 

 

 

Sequence

 

 

 

 

 

 

Database Package

 

 

 

 

 

 

DataSource

 

 

 

 

 

 

Synonym

 

 

 

 

Multidimensional

 

Cube

 

 

 

 

 

 

 

 

 

 

 

Dimension

 

 

 

 

 

 

Fact

 

 

 

 

 

 

DataSource

 

 

OOM (Object Oriented Model)

 

Class

 

Class

 

 

 

 

 

 

 

 

 

 

Interface

 

 

 

 

Use Case

 

Use Case

 

 

 

 

 

 

 

 

 

 

 

Actor

 

 

 

 

Sequence

 

Object

 

 

 

 

 

 

 

 

 

 

 

Actor

 

 

 

 

Activity

 

Object State

 

 

 

 

 

 

 

 

 

 

 

Organization Unit

 

 

 

 

 

 

Object

 

 

 

 

Component

 

Component

 

 

 

 

Object

 

Object

 

 

 

 

 

 

 

 

 

Deployment

 

Component Instance

 

 

 

 

 

 

General Features Guide

 

 

 

 

 

 

 

 

 

 

 

'HILQLQJ REMHFW UHSOLFDWLRQV

0RGXOH

'LDJUDP

2EMHFW

 

Collaboration

Object

 

 

Actor

 

Statechart

Event

 

 

Junction Point

BPM (Business process

Organization Unit

Diagram)

 

Resource

 

 

Message Format

 

 

Data

All modules

File

 

 

Business Rule

 

 

Domain

 

 

 

2EMHFW UHSOLFDWLRQ YV VKRUWFXW

<RX XVH VKRUWFXWV ZKHQ You want to reference an object in the same model or in different models or packages in order to share this object representation between models or packages. The shortcut is not a local copy of the target object therefore it cannot be modified independently from its target object.

<RX XVH REMHFW UHSOLFDWLRQV ZKHQ You want to have a local copy of an object that will allow you to reuse the definition of the original object in the same or different models or packages while preserving the link with it.

Besides, an object replication can also diverge from its original object and be customized according to your needs.

5HSOLFDWLRQ REMHFW SURSHUWLHV

As a replication object has no symbol in the interface, you open its property sheet from the List of Replications dialog box.

You must:

Select ModelReplications to open the list of replications

Double-click a replication in the list to open its property sheet

 

PowerDesigner

&KDSWHU 0DQDJLQJ 2EMHFW 5HSOLFDWLRQV

The definition of a replication object includes the following general properties:

3URSHUW\

'HVFULSWLRQ

Original Object

Model of the original object. The Properties button lets you

Model

open the property sheet of the model containing the original

 

object

Original Object

Full path describing the location of the original object. The

Full Name

Properties button lets you open the property sheet of the

 

original object

Original Object

Type of the original object

Type

 

Original Object

State of the original object model which can be Closed or

Status

Opened or state of the original object which can be Not

 

Found

Replica Object Full

Full path describing the location of the replica object. The

Name

Properties button lets you open the property sheet of the

 

replica object

Generate

Replication is automatically included among the objects

 

generated from the model when you launch the intermodel

 

generation process. For more information, see section

 

Generating replications.

 

 

0RGHOV ZLWK WKH VDPH QDPH

The List of Target Models shows models containing shortcuts or replicas in the current session. It also allows you to get a model full name to distinguish from another.

For more information on how to use the List of the Target Model, see section Using the list of target models in chapter Managing shortcuts.

A replication definition also includes the following properties:

3URSHUW\

'HVFULSWLRQ

Attributes

List of replicated attributes

Collections

List of replicated collections

Sub-Replications

List of replicated sub-objects (for example a column of

 

a replicated table)

 

 

General Features Guide

 

'HILQLQJ REMHFW UHSOLFDWLRQV

2SHQLQJ WKH UHSOLFDWLRQ SURSHUW\ VKHHW IURP WKH UHSOLFD SURSHUW\ VKHHW

You can also access the property sheet of a replication by clicking the Version Info tab in the replica property sheet and clicking the Replication Properties button in the Replicated From groupbox.

Not Found status An original object can indicate a Not Found status in the replication property sheet when the model containing the replication object is opened but the original object cannot be found for the following reasons:

Original object was deleted

Original object was duplicated in another package, then deleted in the original package

Original object model was saved under a new name

In such cases, you must delete the replication.

For more information on how to delete a replication, see section Deleting a replication.

&UHDWLQJ D UHSOLFD

There are two methods for creating replicas, you can:

Use the Replicate Objects dialog box from the Edit menu

Use the drag and drop feature with the ALT + SHIFT keys combination You create an object replication:

 

)URP

7R

 

Browser tree view

Browser tree view

 

 

Diagram window

 

Diagram window

Browser tree view

 

 

 

Diagram window

Links replication

You cannot replicate links, but you can create a link between two replicas in

 

the referencing model.

Replica and

Name uniqueness is automatically checked when you replicate an object, so

namespace

that replicas are renamed in the referencing model when objects with the

 

same name already exist in the model.

 

 

PowerDesigner

&KDSWHU 0DQDJLQJ 2EMHFW 5HSOLFDWLRQV

For more information on the definition of the namespace, see section Managing the namespace in models in chapter Managing Models.

The following example illustrates the replication of Entity_1 in a model that already contains an entity named Entity_1. The Entity_1 replica is automatically renamed to Entity_2 in the referencing model:

&UHDWLQJ D UHSOLFD IURP WKH 5HSOLFDWH 2EMHFWV GLDORJ ER[

You can replicate objects using the Replicate Objects dialog box from the Edit Menu. It allows you to select one or several objects to replicate in the active model or package.

If you select an object that owns sub-objects (a table that contains columns for example or a class that contains attributes or operations), its sub-objects are also replicated. However, if you want to directly replicate a sub-object, you must use the drag and drop method.

For more information on the drag and drop method to create replicas, see section Creating a replica using the drag and drop feature.

ϖ7R FUHDWH D UHSOLFD IURP WKH 5HSOLFDWH 2EMHFWV GLDORJ ER[

1 Select EditReplicate Objects to open the Replicate Objects dialog box.

2 Select a model from the Model dropdown listbox. All available objects of the model are displayed.

3 Select a package from the package selection dropdown listbox. All available objects of the package are displayed.

,QFOXGH 6XE 3DFNDJHV

If you want to display all objects in the model and all objects in packages and sub-packages, click the Include Sub-Packages tool in the list toolbar.

General Features Guide

 

'HILQLQJ REMHFW UHSOLFDWLRQV

4Select the objects you want to replicate from the different tabbed pages and click OK.

The replicas appear in the active model and in the Browser under the appropriate node.

2SHQLQJ WKH 5HSOLFDWH 2EMHFWV GLDORJ ER[ IURP WKH GLDJUDP EDFNJURXQG

You can also open the Replicate Objects dialog box from the diagram background by right-clicking the diagram background and select EditReplicate Objects from the contextual menu that appears.

 

PowerDesigner

Соседние файлы в папке PowerDesigner 9