<< Click to Display Table of Contents >> NShape Concepts
|
By linking a model object to a shape, the shape becomes the graphical representation of the model in a certain diagram. This is useful if you want to add a graphic presentation layer to existing application. In this case, your business objects should implement the IModelObject interface.
In contrast to shapes, model objects are globally available throughout the project, not only in one diagram. Model objects can be linked to shapes by assigning it to the shape's ModelObject property. Multiple shapes can share a model object, even if these shapes are in different diagrams.
Due to this fact, you can present the same business object (e.g. a switch) as electrical symbol in a wiring diagram and the same time as a logical symbol in a switching logic diagram.
But that's not all. When linking model objects to the shape of a template, you can define property mappings between the model object's properties and the shape's properties. This way, the shape automatically represents the state of the model object without writing a single line of code.