Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to model object containment in relational
"Billy Verreynne" <vslabs_at_onwe.co.za> wrote in message
news:1a75df45.0403180021.74d5776b_at_posting.google.com...
| asya_at_bayarea.net (Asya Kamsky) wrote
| > I have a list of base_objects and containers (a table for each:
| > object_table (id, name) and container_table (id, name).
| >
| > Containers contain objects. That's simple to model. However
| > containers can also contain containers. Is there a cleaner
| > way to represent that relationally than
| > join_table (container_id, container_or_object_id, flag) where
| > flag says whether the containee is itself container or object.
|
| I would approach it using the following to relational tables
| (assumming a relational DB implementation with an OO interface layer).
|
| Class = ( class_id[pk], class_name[unique], parent_class_id[fk] )
|
| Object = ( object_id[pk], class_id[fk], object_name[unique],
| parent_object_id[fk] )
|
| Both classes and objects can be nested - i.e. you can have bases
| classes and any number of sub-classes and derived classes. Objects
| also can be instantiated in a hierarchical way, where you get parent
| and child objects.
|
| On the the physical implementation I would consider partitioning and
| IOT and possible clusters.
|
| On top of this I would design Oracle UDTs that provides the interface
| to these two tables.
|
| What is missing from this design is the
| implementation/handling/management of class methods and object
| properties... but seeing that the user specs/requirements in this case
| are non-existant, that's not surprising. :-)
|
| --
| Billy
it would seem that Oracle's OBJECT TYPES would accomplish quite a bit of the requirement here, wouldn't they?
;-{ mcs Received on Fri Mar 19 2004 - 19:23:11 CST