![]() |
How to change type of an instance? |
Post Reply
|
| Author | |
alev
Contributor
Joined: 08.Oct.2010 Location: Arnhem, NL Points: 19 |
Post Options
Thanks(0)
Quote Reply
Topic: How to change type of an instance?Posted: 23.Oct.2010 at 20:52 |
|
Hi,
In this forum I read that one way of implementing a library of reusable "fixed" elements (say of type X) is to make an Object type from these elements (e.g. type Z). Both types are basically the same except that Z is read-only and values of its attributes are not default, but user predefined. A possible scenario is that end-user would like to change type of an instance from Z to X, e.g. to be able to change it. Is it possible to change type "inplace", similar to the "replace" function of MetaEdit+ that works on instances of the same type? Thanks! |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 26.Oct.2010 at 15:42 |
|
Changing the type of an object on the fly would risk breaking rather a lot of constraints, particularly if the object is reused elsewhere.
Better is to apply convention over configuration: if you don't enter anything for a property, some default value is assumed in the generator. That lets the modeler create models quickly, and easily override the defaults where necessary. It also lets the metamodeler improve the default values later without having to change existing instances.
I'm not sure I understand your first two sentences: Do you mean using Fixed List properties with just one value in the list? Or promoting a reusable element to be a type? Using a type instead of a reusable element is described in section 5.4 of our DSM Workshop paper, listed as the first of Monday's sessions here: http://www.dsmforum.org/events/DSM10/.
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |