Build a Domain Specific Language with DSL Tools concluded - Add a New Property (Page 2 of 6 ) Suppose we decide that the current model of the BizEntity domain is inadequate. In this task we will extend the model add a new property to a class in the domain model. In fact, we are going to add a new property to the “Association” relationship. The domain model designer provides the facility to show relationships as though they were themselves classes, in order to be able to add properties to them. You can also create relationships to relationships and inherit from relationships, although we won’t do either in this lab. Click on the BizEntity.dmd tab to take you back to the domain model designer. At the top of the diagram you should see a brown class called “Association”. It is brown because this is a relationship, not a normal class. Open up the Association shape by clicking on the little “+” sign.
Invoke the View->Toolbox command from the main menu to bring the Toolbox window back into view.
Notice that the “Association” class defines two properties, "SourceMultiplicity” and “TargetMultiplicity”, which you have already seen show up at the ends of association lines in the Business Entity designer.
Left-mouse on the value property tool in the toolbox, drag to the main body of the Association class (the brown part), and release the mouse button. A new property called “Property1” should appear in the flap. 
Click on Property1 to select it. You should see that it is selected in the property browser at the lower right of Visual Studio. In this browser, find the Name property under the Misc category, and edit it to read RelationshipType. 
Press Enter to commit the change. The new name should be shown on the diagram. 
Save the BizEntity.dmd file.
Next: Introduce notation for the new property >>
More BrainDump Articles More By MSDN Virtual Labs |