• 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: Mike Schrag <email@hidden>
  • Date: Wed, 13 Feb 2008 11:15:33 -0500

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Converting from one subclass to another
      • From: Ken Anderson <email@hidden>
    • Re: Converting from one subclass to another
      • From: David Avendasora <email@hidden>
References: 
 >Converting from one subclass to another (From: David Avendasora <email@hidden>)

  • Prev by Date: [ANN] JBND update
  • Next by Date: Re: Converting from one subclass to another
  • Previous by thread: Converting from one subclass to another
  • Next by thread: Re: Converting from one subclass to another
  • Index(es):
    • Date
    • Thread