For this example we use the following two classes that have common properties (there must be at least 2 common properties):
We select the two classes, call their context menu, and select the Model Refactoring menu item. The Choose Action page of the Model Refactoring Wizard is displayed:
In the dialog box we select the New complex type option, specify its name and click Next. The Choose complex type properties page of the Model Refactoring Wizard is displayed.
Here we select the properties we want to move to a new complex type and click Finish.
As a result, we get a new complex type containing common properties of the two classes, and the classes obtain a new complex type property:
|
For the purpose of this example we take the model we created in the subsection Using the Model Refactoring Wizard for new complex type creation and complement it with one more class:
Then we select the new class, call its context menu, and select the Model Refactoring menu item. The Choose Action page of the Model Refactoring Wizard is displayed:
On this page we select the Existing complex type option, select the complex type name in the drop-down list and click Finish.
As a result, the complex type contains common properties of all three classes, and the classes contain the corresponding complex type property:
|