MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Mandatory properties and Object properties
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Mandatory properties and Object properties

 Post Reply Post Reply
Author
Message
vladimir View Drop Down
Member
Member
Avatar

Joined: 17.Feb.2012
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote vladimir Quote  Post ReplyReply Direct Link To This Post Topic: Mandatory properties and Object properties
    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
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post 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 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 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
 
 
 
 


Edited by stevek - 17.Feb.2012 at 11:34
Back to Top
vladimir View Drop Down
Member
Member
Avatar

Joined: 17.Feb.2012
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote vladimir Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.035 seconds.