I believe that it does select against all the other nodes as well. I
remember seeing a lot of DB traffic with Vertical and wondering why it
would need to select against the tables for the other subclasses.
The only fault I can see with Single Table is that it can cause
constraint difficulties when combined with Microsoft SQL Server due to
MSSQL's lack of deferred constraints. If you're not using MSSQL, then
I'm not going to get into the gory details.
I think Chuck's comment of "Vertical is the least efficient and the
least used hence has a higher probability of bugs." is spot-on. It
seemed like every time I turned around I was running into something
that was more tricky because of VI.
ST is kinda ugly in the DB, but at least if you do a query from
another application, you don't have to join a bunch of tables together
to get one record. If other things are going to _write_ to the DB,
then you will miss the DB not null enforcement, but that's a small
price to pay, if you ask me.
I've taken to adding awakeFromFetch calls to any entity that can be
written by other applications that will automatically write a default
value for any Entity that is read from the DB with nulls where they
shouldn't be.
Dave
I was and am using Microsoft SQL Server, so I also run into all kinds
of problems with constraints.
On May 7, 2008, at 4:46 PM, Robert Walker wrote:
Vertical or horizontal? With vertical this will still select on
the root, won't it?
That's actually a good question. It will have to select against the
root, obviously, to pick up those attributes, but I don't think it
then calls all the other siblings if you call against a leaf node,
but I could be wrong about that.
I think it has a similar performance hit as a one-to-many
relationship when accessing leaf node. But, if you call the root
node I thought it would then access the entire tree, which can be
really bad.
On May 7, 2008, at 4:27 PM, Chuck Hill wrote:
On May 7, 2008, at 1:14 PM, Robert Walker wrote:
Agreed,
The only time vertical inheritance makes sense if when you always
fetch against leaf nodes of the inheritance tree and only if the
inheritance tree is very shallow. Take that to mean one level deep
of inheritance with an abstract root entity that you never fetch
against.
Anything more complex than that I would recommend single-table.
My 2 cents.
Vertical or horizontal? With vertical this will still select on
the root, won't it?
Chuck
On May 7, 2008, at 3:54 PM, Chuck Hill wrote:
On May 7, 2008, at 12:48 PM, Florijan Stamenkovic wrote:
Hi all,
In the "[slightly OT] data modeling question" there is some talk
of drawbacks of inheritance, specifically of vertical
inheritance... Since I am currently contemplating implementing a
reasonably complex system, and have thought of using vertical
inheritance, this has got me worried. So, what's the deal???
My situation: a structure of over 10 entities (15ish),
inheritance up to 4 levels in depth. The amount of records per
entity will be quite small (ranging from 5 - maybe 30), so I do
not worry about performance. Many operations will be defined on
the topmost entity. Relationships will almost always relate to
the topmost entity, which will be abstract. I might want to
define additional subentities in the future. Subentities will
have a sufficient amount of their own properties to discourage
me from single table inheritance. Horizontal might do, I do not
think I will be changing the existing structure once made.
I've never done inheritance till now. Am I going to commit
suicide over this?
You might want to check for suicide exclusions in your life
insurance policy. :-) David Avendasora was using Vertical with
JC. He stopped. Maybe he can provide some pointers. My advice
would be to ignore that "Subentities will have a sufficient
amount of their own properties" and use Single Table. Or,
failing that, Horizontal. Vertical is the least efficient and
the least used hence has a higher probability of bugs.
Chuck
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/robert.walker%40bennettig.com
This email sent to [EMAIL PROTECTED]
Robert Walker
[EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
This email sent to [EMAIL PROTECTED]
--
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
Robert Walker
[EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (Webobjects-dev@lists.apple.com)
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 (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]