Working with a Constructor

From RAD Studio
Jump to: navigation, search

Go Up to Class Diagram Procedures

You can create as many constructors in a class as needed.

In design projects, a constructor is created as an operation with the <<constructor>> stereotype.

In implementation projects, each new constructor is created with its unique set of parameters. In addition to creating parameters automatically, you can define the custom set of parameters, using the Object Inspector.

To define the constructor parameters (implementation projects only)

  1. Select the desired constructor in a class.
  2. In the Object Inspector, click the Parameters property.
    • In the in-place editor, type the list of parameters. Use commas as the delimiters.
    • Click the button appeared at the right of the Parameters property. The Add/Remove Parameters for Operation editor opens; type the list of parameters.
Tip: You can move, copy, and paste constructors and destructors between the container classes in the same way as the other members.

See Also