Re: Vertical inheritance with a non-abstract superclass
Re: Vertical inheritance with a non-abstract superclass
- Subject: Re: Vertical inheritance with a non-abstract superclass
- From: "Nathan Gabrish" <email@hidden>
- Date: Mon, 10 Mar 2008 10:34:55 -0400
Thank you for the help. I was able to pass the consistency check by adding restrictive qualifiers to both the super and subclasses (I could have sworn I had tried that already) however, this does not seem to work across models. What is a little confusing to me is the need to put a qualifier on the superclass. I would think that any record in the superclass table could be instantiated as that superclass, assuming it is not abstract.
The reason I would like to use Vertical Inheritance is to gain some benefits on the back end as well. By moving unique fields, typically needed on the front end only, into subclasses I am able to trim the superclass down to make batch processing much less resource intensive. My hope is that I can also see some performance gains on the front end when working with large collections when I only need the superclass attributes not to mention writing reusable code.
On Mon, Mar 10, 2008 at 9:35 AM, David Avendasora <
email@hidden> wrote:
Non-abstract superclasses must have restricting qualifiers as well as
their subclasses. What were the restricting qualifiers you used? They
must be unique.
Do you have any choice in the use of Vertical Inheritance? I used to
use it as it made my "DB Normalization" voice stop screaming at me,
but in the end it was just too problematic for me.
I switched to Single Table inheritance for all my Vertical Inheritance
uses and have been much happier since. The main thing you loose is
the DB being able to accurately keep track of which fields can be null
and unique and such, but if the only system using the DB is WO, then
the Model will keep track of that for you, There's no need to do it in
the DB as well.
It took me a while, but I found that if I just trust WO to do it's job
and not try to anticipate it failing, I am a much more productive
developer.
Dave
On Mar 8, 2008, at 8:50 AM, Nathan Gabrish wrote:
> I am attempting to create a subclass by inheriting from a non-
> abstract superclass using the vertical inheritance method. I have
> followed the steps outlined in Apples documentation for EOModeler
> but I am still getting consistency checks when I save.
>
> The consistency check that is returned when I attempt to save is as
> follows:
> "Entity Superclass (parent entity of Subclass) needs a restricting
> qualifier in order to filter out rows in table SUPER that are only
> holding data for Subclass instances"
>
> The documentation is a little unclear (to me at least) as to whether
> or not I really do need a restricting qualifier when using vertical
> inheritance but I have tried adding it anyway. I have tried adding
> the qualifier both to the superclass and subclass but I still get
> the consistency check in each case. The only way I have found to get
> around the consistency check is to mark the superclass as abstract,
> however I need to be able to instantiate objects of the superclass
> in this case so that is not going to work for me.
>
> Is it possible that the consistency check is just a bug in this case
> because EOModeler does not recognize which tye of inheritance
> mapping I am using?
>
> I am currently using version 5.1 of Webobjects.
> _______________________________________________
> 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