cancel
Showing results for 
Search instead for 
Did you mean: 

Class Diagram Attributes - data types

MountainKing
Explorer
0 Kudos

Hi,

If I create a new Attribute for a Class in a UML Class Diagram in PowerDesigner, I can define a Data Type in both the General and Detail tabs of the Attribute properties.

The definition (from the PD help) of a Data Type in the General tab is "Set of instances sharing the same operations, abstract attributes, relationships, and semantics."

The definition of a Data Type in the Detail tab is "Specifies a persistent data type used in the generation of a persistent model, either CDM or PDM. The persistent data type is defined from default PowerDesigner conceptual data types."

The list of allowable data types for the two tabs is different.

Can somebody explain the differences between these two data types? I am assuming if generate a PDM from my OOM, I would need to set the data type at the Detail level to get something meaningful when generating some DDL, correct? I don't really understand the definition above of the data type at the General level.

Thanks,

Antony

Accepted Solutions (1)

Accepted Solutions (1)

former_member192453
Active Participant
0 Kudos

Hi Antony,

General Tab:

The data types listed are the allowable data types for the selected Object language. The list is a populated from the item listed under the :Settings\DataTypes section of the XOL file. The list includes values from the AdditionalDataTypes and the BasicDataTpe items. If you change the XOL, then the list of available data types will change.

For example, if Java is the selected Object language, then the list will include valid Java data types.

Detail Tab:

This is a list of the standard PD data types (same list available in a CDM). Via this tab, you can define specific data type mappings for use when generating a CDM or PDM. If no value is specified, then PD will use default data type mappings during inter-model generation.

For example, I have an OOM with Java for the Object language

Create a Class with two attributes and set java.lang.Character as the data type for both.

Attribute_1 – set VARCHAR (25) as the data type on the Detail tab

Attribute_2 – make no changes to the Detail tab

Preview the Class, the code includes Java syntax

Generate a PDM from the OOM, the java.lang.Character data type is generated with different values

Attribute_1 has VARCHAR (25) as its data type

Attribute_2 has CHAR(1) as its data type

Does this help?

Anthony

MountainKing
Explorer
0 Kudos

Hi Anthony,

Thanks, that does help. I built a Class trying to use all the available Data Types from the drop-down list in the Attributes tab (38 if I didn't miss any!), then I generated an Oracle 11g PDM to see how these would be represented in the corresponding table - see the two attached screenshots.

As you can see, I didn't select any Data Types from the Detail tab for the Attribute, so I presume PD has applied a default treatment from the Class to the Table for all attributes. As we may well need to generate some Oracle tables with meaningful data types and lengths from the Classes, it looks like specifying the data type in the Detail tab will be imperative, as your example has highlighted.

Interestingly, when I recreated your example, Attribute_1 in the Oracle table in the PDM shows the Data Type from the Detail tab, not the General tab.

regards,

Antony

Answers (0)