index > Visual Studio Team System - Domain-Specific Language Tools > Referencing Domain Classes from Domain Properties

Referencing Domain Classes from Domain Properties


Greetings - I'm building a DSL and I've got a question. Once in the DSLs designer, for a specific property on an instance of a Domain Class, I would the property to provide a *filtered* selection list of other instances of Domain Classes.

For example, if I have a instance of a Domain Class named "Attribute" and it has two properties, one is "Name" and the other is "Type". I might set the "Name" property to "HomePhone" and the "Type" property to "PhoneNumber". I want the value "PhoneNumber" to point to some other instance of a Domain Class named "PhoneNumber".

Basically, I want user to be able to create a diagram that models their business objects, and have the ability to use there business objects as types to select from.

Any ideas? (apologies if my explanation is confusing)

Thanks,

Jordan T.

Jordan Terrell

Jordan

DomainProperties are designed to have value types (int, bool, enum, etc) or string. If you want to refer to a DomainClass, use a reference relationship. This will generate a property in the code, and if the multiplicity is 1 will show up in the property grid of your target designer.

-- Steve Cook

Steve Cook MSFT

Hi Jordan,

Generally, you always model class-values properties by creating a reference relationship with multiplicity 0..1 or 1..1 between the source and target.

So you might create AttributeHasType bwetween Attribute and Type.

With a multiplicity of max 1, you'll automagically get a property in the property grid of yoru attribute that allows you to pick from the elements of type "Type" in your model.




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

You can use google to search for other answers

 

More Articles

Use of the TextTransform tool
DSL Tools vs VSTS designers
How to set formatting to the strings displayed in compartment?
Set Inherited Properties
How to set the connector decorator position to middle of the link...
Relationship from CompartmentItem and port shapes
Problems with DSL Tools Version 1
Experience report: Building my own DSL
Compartment Shape Equivalents
Controlling and detecting what elements are droppable on the diag...
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Reordering items in compartments?
Extending a DSL post-deployment
.tt files shouldn't be copyrighted
Designer code templates - where are they?
Shape position from a template...
Administrator priviliges required
Outline Pen Width
Using domain specific language
Validation Framework
Problem creating a DSL project
Diagram Size
Three mystic symbols
Troubleshooting: duplicate generated files
Welcome to the Domain-Specific Language …
Referencing Domain Classes from Domain P…

Hot Articles

new connectors
Error in "Domain-Specific Language …
Inherited classes and their compartment …
Open a new Document
Announcing DSL Tools May 2005 CTP for Vi…
How to clip shape text?
my feedback about dsl
circular dependency and custom properties
Enable/Disable property OnValueChanging/…
Using a Template to iterate on all model…
Generating Code From a Model Walkthrough
Unable to Start Debugging !!!
Suggestion - Context Menu: Override Beha…
How can I add existed DataBase scheme to…
Upgrade bug: Only 8.1 version of TextTem…

Recommend Articles

Problem running Debug solution
DSL Tools Team HIRING in Cambridge, UK
missing menu options in visual studio
Opening an existing DSL in a fresh insta…
Error : Value cannot be null ,Parameter …
Feedback
Process to create report at design time
DSL Tools for RTM?
Localization
Is there any DSL Specifications?
Unregister DSL file extension
When do you plan to update documentation…
DSL Setup project fails to compile
May CTP is available....
protected internal