index > Visual Studio Team System - Domain-Specific Language Tools > Compartment Shape Equivalents

Compartment Shape Equivalents


Hi,

I checked out the compartment shapes walkthrough and i have a similar scenario - to implement an embedded relationship. I have defined a image for the class into which i want another class embedded in to. If i have to implement compartmentshape for the embedding i have to change the imageshape to compartment shape. Is there any way i can retain my image and still implement the embedding relationship? Kindly let me know.

Thanks,




Suraj Guptha
Suraj Guptha

Suraj,

It depends on how you want to visualize the relation. What kind of image is it, do you need it as a full shape?

You could put your image manually with some code on the top of the compartment shape. Dunno it this fits your needs? You can do this with code like this. Change the DrawString with something like drawimage and position it the way you want.

Otherwise I would suggest to change it to an reference relation if you really need the image as a full shape. But I don't know if that makes sense in your DSL.

Hope it helps,

Gerben.

gerbenvl

Hi Suraj,

So let me check if I have your request correct.

You have an image shape as a parent and you'd like to visualize some other shape as an embedded child of that image shape?

I'll continue on the premise that I've understood you correctly. In our V1, we don't support visually embedding child shapes inside anything except the main diagram or a swimlane or using compartment line items.

Gerben is certainly right that you could decide to just switch your embedding to a reference relationship. However, in our new June CTP we're a little more flexible as you can map connectors to embedding relationships if you need to.

You should be able to achieve an effect like this.

If you set up a Connector to map to the embedding relationship between the parenting class and the thing you want to embed in it (no need for a matching Tool for the Connector) then drop the sub-shape onto the parent shape from teh toolbox, the ElementMergeDirective will connect the ModelElement mapped to the subshape as a child of the ModelElement mapped to the parent shape. A connector will then spring into life to represent the embedding relationship instance and link the two together. The one extra detail you need to set in your model is to set the element parent path in the ShapeMap for your child shape, so its shape ends up parented on the diagram rather than on the class you dropped it on.

If you start with the Minimal Sample in the June CTP and add a ChildElement DomainClass as an Embedding of ExampleElement then the path will look something like:

ExampleElementHasChildElement.ExampleElement/!ExampleElement/ModelHasElements.ExampleModel/!ExampleModel

Hope this moves you forward.




Gareth Jones - Developer - DSL Tools & Software Factories Platform [MSFT]
GarethJ MSFT
Hi Suraj, did this help you out?


Gareth Jones - Developer - DSL Tools & Software Factories Platform [MSFT]
GarethJ MSFT
reply 4

You can use google to search for other answers

 

More Articles

Slip in schedule
Connectors connecting to connectors
Custom source for connector
Controlling and detecting what elements are droppable on the diag...
Name of new elements
Do all custom properties have GUIDs?
The definition of Triangle and Rectangle shape in Domain Model.
Transaction.RollBack() Error: Oject reference not set an instance...
New version of DMD -> DD is available (for DSL Tools May 2005 ...
Error with DSL Project Setup
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

How to wrap words of one single line to …
Nested Shapes
How to manually process template in June…
What can be created with DSL?
DSL Tools / VS.NET RTM
Beginners Question on code generation
Using existing Enumerations
How do I change the color of a connector…
Installation Problems? "operation i…
Reference from one DSL metamodel to anot…
Interacting with Server Explorer
Deployment - I can't find the template
connections restrictions between shapes …
Adding files generated with text templat…
Error : Value cannot be null ,Parameter …

Hot Articles

Infopath as editor
How are new objects created in a DSL?
What is the future of MDA?
Reading and writing models in June relea…
DSL Tools Sept CTP and WinFX Sept CTP?
Keeping separate models in step
How can I order compartments within a sh…
Context menu item localization
Shape Icon and Shape Tool Minor Bug
Can I Generate Code with CodeDom in the …
Shapes that are not directly related to …
Any Practical Limits on Model Size?
Announcing: SharpLudus, a software facto…
fatal error CTC2013: Can't start preproc…
DSLTools download moved?

Recommend Articles

Nested Concept and Nested Diagram
problem when following "Walkthrough…
Enterprise Library
General Questions
Extending right-click menu for DSL class
Relationship representation
N-ary Relationships
circular dependency and custom properties
Add shapes and connectors to diagram pro…
Multiplicity Value Property
UIPChart problem
Dynamically Create Links OnAttributeChan…
Process to create report at design time
Nesting relationships, can't link to Ima…
Designer code templates - where are they?