• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Converting from one subclass to another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting from one subclass to another


  • Subject: Re: Converting from one subclass to another
  • From: David Avendasora <email@hidden>
  • Date: Wed, 13 Feb 2008 11:40:28 -0500

Thanks for the very clear, informative and helpful answer!

Even if it's the one I didn't want to hear. :)

Dave

On Feb 13, 2008, at 11:15 AM, Mike Schrag wrote:

I could just create a new object of the new class and delete the existing one
yes

What is the best way to get WO to pickup the subclass change immediately?

Or is this just a bad way of doing things?
yes

Inheritance hierarchy is to be treated like a PK -- It's an unchanging attribute of an EO. In fact, it's actually part of the EOGlobalID.

What you're describing is very similar to the Employee vs Manager modeling problem. The general consensus is that when an Employee becomes a Manager, it's not changing types, it's changing Roles, so it's actually a Person=>Role, where Role is Manager or Employee and you are just changing the relationship, not the intrinsic type.

You should consider type to be immutable for your own safety and the safety of those around you. The correct way is to delete your old class and make a new one, or maintain a relationship to (something like) a NutrionValueCalculator that changes (if there is a lot of other state in this object other than just this value).

ms

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40avendasora.com


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Converting from one subclass to another (From: David Avendasora <email@hidden>)
 >Re: Converting from one subclass to another (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Converting from one subclass to another
  • Next by Date: Re: help for newbie with WO Apple example on Eclipse+WOLips
  • Previous by thread: Re: Converting from one subclass to another
  • Next by thread: Re: Converting from one subclass to another
  • Index(es):
    • Date
    • Thread