Print Page | Close Window

How to change type of an instance?

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=180
Printed Date: 27.Mar.2026 at 02:16
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: How to change type of an instance?
Posted By: alev
Subject: How to change type of an instance?
Date 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!



Replies:
Posted By: stevek
Date 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/ - http://www.dsmforum.org/events/DSM10/ .



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