tags:

views:

204

answers:

1

I have a DSL containing two main domain classes: Area and Entity. Areas are represented visually by a GeometryShape, whereas entities are represented by a CompartmentShape. Entities can be embedded in an Area, or not (in this case they are embedded in the root object, which is a kind of Area). There may be relationships between entities, including between entities in different areas. Areas cannot be embedded inside of other areas, nor entities embedded inside of other entities.

My problem is that I cannot get the behavior I want from the diagram. The embedding of entities in areas works perfectly well at the model level, but the visual representation behaves erratically. For example, if I drag an entity that was created in an area outside of that area, it no longer responds to mouse clicks (I have code that performs the re-parenting, but somehow the diagram side of things is broken).

I have searched high and low for samples of how to do this, and come up empty. Every example I've found on the web simulates nesting via "references" relationships, whereas I am performing true embedding of the domain classes (and therefore of their associated shape classes).

Does anyone have an example of how to do this?

While I'm venting, am I the only one who thinks the diagram/shape classes are massively under-documented?

A: 

I believe there's an example of this in Domain-Specific Development with Visual Studio DSL Tools. Also, you might want to ask on the Visual Studio Extensibility forum.

John Saunders
The book simulates nesting via "references" relationships.
Paul Lalonde
And it doesn't work if you do the same thing, but with an embedding relationship?
John Saunders