Defining operations
76
Adding a Copy constructor to a class
The body of a Copy constructor contains a copy of the attributes of the class
that exist at the moment of the creation of the constructor.
When you create a Copy constructor, it has the same as that of the class,
prefixed by the keyword new. It has a default parameter that you can modify,
or you can add other parameters.
If the class is an instance of another class, the attribute names within the body
of the Copy constructor operation are the same as those in the parent class.
You can define only one Copy constructor to any given class.
v
To add a Copy constructor to a class:
1
Double-click a class in the model.
2
Click the Operations tab.
3
Click the Add button.
4
Select Copy Constructor from the dropdown list.
A Copy constructor is created at the end of the list of operations for the
class. It has the same name as the class to which it belongs.
Summary of Contents for Powerdesigner 7.5
Page 1: ...OBJECT ORIENTED MODEL User s Guide POWERDESIGNER 7 5...
Page 8: ...viii...
Page 22: ...Defining OOM properties 12...
Page 144: ...Defining check parameters 134...
Page 208: ...Generating for XML 198 6 Click OK An XML file is generated with the file extension xml...
Page 210: ...Customizing scripts 200...
Page 224: ...Generating a CDM from an OOM 214...
Page 238: ...Generating a PDM from an OOM 228...
Page 260: ...Object language editor categories 250...
Page 268: ...Applying business rules to objects 258...
Page 288: ...278...