Newbie just getting started with V4RB: Is-a relationships
Ruslan Zasukhin
sunshine at public.kherson.ua
Fri Feb 28 21:40:58 CST 2003
on 2/28/03 9:22 PM, Stefano Franchi at s.franchi at auckland.ac.nz wrote:
Hi Stefano,
> I am just getting started with Valentina for RealBasic, and I need to
> clarify a couple of issues about hierarchical relationships in
> Valentina before I get started with database design.
>
> Say I have an object "Book" with all the usual fields. It is a
> subclass of VBaseObject. If I need to specialize Book into
> "ManuscriptBook" (for example) can I subclass it and inherit all the
> properties of Book? This is what some Object-relational RDMS like
> PostgreSQL allow. But I'm not clear if Valentina allows it as well.
Right now no, but we definitely will,
And in the way little different from Postgre.
> If it isn't possible, how do people normally implement Is-a
> relationships like this one in Valentina? Two standard approaches come
> to mind:
> a. With manually maintained 1-1 relationships between child and parent
> tables? Or
Yes!
And use ObjectPtr field in the child table for this,
Make it unique, to get 1 : 1
> b. with so-called "horizontal" design (i.e. by having only children and
> replicating all the parent's fields in each table)?
NO! bad idea.
> I very much prefer the first approach, but it usually takes quite a
> significant performance hit in traditional RDBMS, because of all the
> joins needed to reconstruct the complete entity. Design is cleaner,
> though, and easier to maintain. Is Valentina's famed speed a good
> reason to dismiss the performance hit? Does it even suffer from it (I
> have no idea, yet I hope, of how different Valentina is from a RDBMS
> internally)?
Yes, ObjectPtr field is SPECIALLY designed to support this -- INHERITANCE.
I self will use it for inheritance in future versions.
In fact ObjectPtr field is 4 times faster of RDB links,
And JOINS in Valentina will be much faster of RDBMS.
And wait the moment. I think Postgre also simply relate 2 tables...
Although do not remember. IF they go by second way then this is really bad
way.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list