Print Page | Close Window

Mandatory properties and Object properties

Printed From: MetaCase
Category:
Forum Name: MetaEdit+
Forum Description: All topics relating to MetaEdit+ or DSM
URL: https://www.metacase.com/forums/forum_posts.asp?TID=393
Printed Date: 27.Mar.2026 at 03:35
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: Mandatory properties and Object properties
Posted By: vladimir
Subject: Mandatory properties and Object properties
Date Posted: 17.Feb.2012 at 11:10
Hi,

I'm new to MetaEdit+. I have been working with it for several days now and I have two questions.

First: can I make some object's properties mandatory? I need to define some of them to be mandatory so when someone wants to place them on the graph he must first enter all of the object's mandatory properties.

Second: lets say I have hierarchy of objects. One parent and three child objects inheriting the parent. I need to have one property in another object that can be of type of some of those child objects but not the parent itself. So when I set the property to be of parents datatype, although child objects can be set here, the parent object can be set to. How can I solve this problem?

Thanks in advance for any help.
Best regards,
Vladimir



Replies:
Posted By: stevek
Date Posted: 17.Feb.2012 at 11:32
Hi Vladimir - welcome to MetaEdit+ and the forum!
 
You can make properties mandatory by defining a regular expression for them, e.g. .+ would require a property to be non-empty. Just fill the http://www.metacase.com/support/45/manuals/mwb/Mw-Appendix.html - regular expression in to the Property Tool's Value Regex field.
 
However, be careful not to be too strict - as Postel's Law indicates, try to accept any input. Where possible, make your generators cope with empty values by outputting suitable defaults. This reduces the work the modeler needs to do, and reduces the amount of information other modelers need to read. Convention over configuration! (BTW, being too strict is just one of the 20 anti-patterns mentioned in the IEEE Software article on http://www.metacase.com/papers/WorstPracticesForDomain-SpecificModeling.html - Worst Practices for DSM , based on experience over 76 cases.)
 
If you want to allow only some types in a hierarchy to be instantiable, make the other types abstract by changing their name to start with an underscore, _.
 
Hope this helps,
Steve
 
 
 
 


Posted By: vladimir
Date Posted: 17.Feb.2012 at 19:15
Steve,

Thank you for your quick and very comprehensive answer. Those directions helped me a lot.

Best regards,
Vladimir



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.05 - http://www.webwizforums.com
Copyright ©2001-2022 Web Wiz Ltd. - https://www.webwiz.net