Nathan,

I think you will find that Vertical Inheritance is much more resource intensive than you'd think. David Elliotts email points this out in that if query an object of the superclass or any one subclass is requested, it does a query for each possible subclass as well. So if you have 3 subclasses, it will do 4 queries, even if you are only trying to instantiate one of the subclasses, or even if you are just trying to instantiate the superclass.

With single-table inheritance, if you are loading the superclass, even though the query may bring back all the fields for all the subclasses as well, it does it in one DB operation, that is going to be much less overhead than what VI does.

To me, Vertical Inheritance should be viewed as something to use when you are trying to make use of data in a legacy database, not as a tool for designing a new database.

Also, because of the way WO uses faults, what you are trying to avoid likely isn't even a problem in the first place.

If the only reason you are using Inheritance in this situation is to split off attributes that aren't required, then I think you're going to want to really reconsider using Inheritance at all.

As far as making it work across models, is this a new project or an existing one? It sounds like you are trying to implement many of the more complicated EOF concepts in a new project.

Make it work. Then make it work right. THEN make it work fast.

Dave


On Mar 10, 2008, at 10:34 AM, Nathan Gabrish wrote:

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 PROTECTED] > 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 protected])
> Help/Unsubscribe/Update your Subscription:
> 
http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com
>
> This email sent to [EMAIL PROTECTED]



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to