This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Kudos to Ivan for writing the excellent post on inheritance, which saved me a lot of work last night: http://www.mindscape.co.nz/blog/index.php/2009/03/01/getting-started-with-inheritance-in-lightspeed/ I wanted to chime in, however, as to how valuable it would be to have Pull Up and Push Down refactoring actions on the designer so we don't have to delete and re-add properties when moving them to and from the base class. You end up losing all your settings, custom attributes, and all other stuff when doing so, which will allow all kinds of errors to creep in. Just compiling thoughts for LightSpeed 3.0 or a nightly build ;) Regards, Dave
|
|
|
I've added this feature and it will be in nightly builds dated 26 Mar 2009 and above, available from about 1430 GMT. To use the feature, right-click a property and choose Move to Base Class or Move to Derived Class as appropriate. If you are moving a property to a base class, you also have the option to scan for occurrences of the same property in other classes derived from the same base class, and remove them: this is to handle concrete table inheritance scenarios where, say, you have dragged on a bunch of leaf tables which all have Name columns, but want the Name property to appear on the common base class -- saves you manually deleting the Name property off all the other entities. There are a couple of limitations / UI warts: * You can only move one property at a time. I don't think this will normally be a serious limitation, but if you have scenarios where you are bringing most of an entity up into a base class, it could get vexing. Let us know if this is a pain point for you. * It will always prompt for the class to move to. There are some cases, where there is only one candidate class and any options are no-ops, where this prompt is redundant. Again, if this becomes a pain point, we can try to make it a bit smarter. Please let me know if you run into any problems or have any feedback! |
|
|
Ivan, A couple of things I am thinking about. * If I am moving a property to a derived class, shouldn't I be able to choose multiple derived classes to move the property? Right now I can only select one derived class to move the property to and I am using concrete table inheritance. * On move to base class, I intentionally had the same property name on two siblings but they varied in settings ( length and whether unique ). Shouldn't the designer check to verify that settings are identical in the sibling properties, notified me if they aren't, and still give me the opportunity to move the property to the base class? Right now it just takes the property settings from the entity I clicked and uses those settings.
Regards, Dave |
|
|
Good points. The initial motivation for the Move to Derived Class action was to improve the single table inheritance experience for database-first design, where typically you have a field that is applicable only to a particular subtype. You're right, though, even in that scenario a field could be applicable to multiple subtypes. I'll get that added. Regarding the sibling detection, this is primarily a complexity thing. There are potentially a lot of settings, some of which are significant and some of which are not. I'll update the matching algorithm to be a bit smarter and implement some confirmation UI. |
|
|
Hello David, These updates are now implemented and will appear in the 28 March nightly. The sanity checking of merging properties is fairly basic for simplicity: it checks data type, nullability and common validations (e.g. uniqueness, presence, length). We'd welcome your feedback on whether more sophisticated detection or additional feedback info is required. |
|