Re: Can an entity be promoted in single table inheritance?
Re: Can an entity be promoted in single table inheritance?
- Subject: Re: Can an entity be promoted in single table inheritance?
- From: Mike Schrag <email@hidden>
- Date: Wed, 31 Mar 2010 22:55:07 -0400
1) explosions
2) almost always indicative of a design flaw
Your example, for instance, is much better captured with Roles ... The peasant isn't himself changing, his role is changing. It may be TECHNICALLY possible to pull this off with a ton of craziness, but it would be horribly error prone. Imagine what would happen if you had a Peasant EO instantiated. What in the world would happen? (answer: explosion)
On Mar 31, 2010, at 10:48 PM, Ramsey Lee Gurley wrote:
> I can't see this being possible in Vertical or Horizontal, but with single table... could the qualifying attribute be updated to 'promote' an entity to a new class? Let's say we have we have an abstract Person entity with three subclasses, Peasant, Knight, King. If I wanted to promote a knight to king, is it possible to simply update my type attribute from knight to king and EOF will start treating that record as a king instead of a knight? I would assume I would need to invalidate the existing knight object after saving changes so it could be refetched as a king... and if I had multiple instances, I'd need to invalidate it in those instances too... but is it possible? Or will EOF just flip out in the saveChanges() and refuse to do it?
>
> Just an academic question, of course (^_^)
>
> Ramsey _______________________________________________
> 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
_______________________________________________
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