cancel
Showing results for 
Search instead for 
Did you mean: 

Inheritance between two packages

Former Member
0 Kudos

Hi guys,

fist of all thank you very much for your support. My last issue has been solved very quick.

Now I have a new problem regarding inheritance between two packages.

In detail:

I have two tables which are located in different packages.

Package X:

     Model A

     Table 1

Package Y:

     Model B

     Table 2

Now I want in Model A to create an inheritance tree where Table 2 inherits from Table1. This is not possible by default. The only way I have found out is to create an extra package and move the tables there and use the inheritance as a shortcut in model A.

Is this possible without this workaround?

Thank you very much. I hope the explanation is understandable.

Cheers,

Ahmet

Accepted Solutions (1)

Accepted Solutions (1)

marc_ledier
Active Participant
0 Kudos

Hi Ahmet,

You need to figure that shortcut use must not modify target object (the object behind the shortcut).

In your case, having an inheritance would migrate attributes to child and therefore modify child.

To avoid creating a third package, you can create the inheritance in the browser only then add a symbol in your diagram you want (this will create a shortcut of inheritance).

In browser, on the package that contains the child entity, right-click and create inheritance. Fill the parent in main page using the Select Object tool that allows searching in any package. Select your parent entity

=> This creates a shortcut of parent in child package

Now from Children page of entity, add your child entity then OK

The inheritance is defined between shortcut of parent entity and child entity in the child package. No symbol is drawn on diagram

You can now drag inheritance in target package (you may need a complete link from Tools menu)

Marc

Former Member
0 Kudos

Hi Marc,

thank you for your quick response. It worked well.

My next question is:

How is inheritance done when a second child is located in a third package?

Like:


Package A

     Diagram A

     Table 1

Package B

     Diagram B

     Table 2

Package C

     Diagram C

     Table 3

Now I want to model in Diagram A an inheritance where Table 1 is Parent and childrens are Table 2 and Table 3.

Because I need an inheritance where several children are in different packages.

Thanks a lot


Cheers,

Ahmet

marc_ledier
Active Participant
0 Kudos

Hi,

In that case, you need to create several inheritances.

But may be you may try to use distinct diagrams instead of distinct packages.

LDM does not have strict design rules that implies the use of package (as opposite to UML/OOM).

Usually, Data Modelers don't use the concept of package a lot.

Marc

Former Member
0 Kudos

Hi,

the problem is how to express mutually exclusive children with several inheritances?

First we had distinct diagrams but then we changed to distinct packages because of Check-In and Check-Out on package level.

Cheers,

Ahmet

marc_ledier
Active Participant
0 Kudos

Hi;

This means that you will have to model the whole inheritance (parent and children) in the same package, then use shortcuts of children in other packages.

PowerDesigner has designed its packages to enclose object definition. Having an inheritance is a very strong link between objects (they are typically the same concept, split in several sub-concepts).

My first thoughts would say that they belong to the same package, holding the definition of the concept.

Then, other packages may describe the use of these objects and show shortcuts to design it.(potentially including definition of other concepts, reused somewhere else).

Marc

Former Member
0 Kudos

Hi,

we have it already in an additional package. But this additional package makes the whole model more complicated. Because the tables should be in the proper package where they belong and not in an additional package. I think we cannot avoid this additional package.

Good point but there are industries where this is necessary.


Although thank you very much, Marc

Answers (0)