dbTalk Databases Forums  

Database which allows object to be "child" of any other object

comp.databases comp.databases


Discuss Database which allows object to be "child" of any other object in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kuronekoyama@gmail.com
 
Posts: n/a

Default Database which allows object to be "child" of any other object - 04-09-2009 , 12:37 PM






I'm working on a database-driven project and I'm trying to do some re-
architecting of the system.

I would like to cut down on the number of strictly-defined complex
object types, instead forming them from a composition of attached
atomic metadata objects. A user could have an attached phone number,
an attached address, an attached photo; but furthermore, an address
could have an attached photo or phone number.

This means that in the DB, my relationship cannot be simply from the
"PhoneNumber" table to the "User" table. It must allow relationships
from each metadata table to, potentially, every other metadata table.
This **could** be done using n^2 association tables for each parent/
child combination of metadata tables, but that would suck major donkey
balls. It could also be done by having a generalized association
table which specifies both the table *and* the key of the parent and
child in the relationship, but I can think of no way to set up
automatic referential integrity checking when doing this.

My questions are:

* Is this a viable approach? Has it been done before, is there a
common name for it?
* Is the "generalized association table" idea compatible with
automatic referential integrity checking? If so, how?
* Are there any systems out there implemented in this way that I could
examine for research, open-source or not?

Reply With Quote
  #2  
Old   
Bob Badour
 
Posts: n/a

Default Re: Database which allows object to be "child" of any other object - 04-09-2009 , 12:54 PM






kuronekoyama (AT) gmail (DOT) com wrote:

Quote:
I'm working on a database-driven project and I'm trying to do some re-
architecting of the system.

I would like to cut down on the number of strictly-defined complex
object types, instead forming them from a composition of attached
atomic metadata objects. A user could have an attached phone number,
an attached address, an attached photo; but furthermore, an address
could have an attached photo or phone number.

This means that in the DB, my relationship cannot be simply from the
"PhoneNumber" table to the "User" table. It must allow relationships
from each metadata table to, potentially, every other metadata table.
This **could** be done using n^2 association tables for each parent/
child combination of metadata tables, but that would suck major donkey
balls. It could also be done by having a generalized association
table which specifies both the table *and* the key of the parent and
child in the relationship, but I can think of no way to set up
automatic referential integrity checking when doing this.

My questions are:

* Is this a viable approach? Has it been done before, is there a
common name for it?
If I am not mistaken, a name used for it before was "universal
relation", but I could be wrong.


Quote:
* Is the "generalized association table" idea compatible with
automatic referential integrity checking? If so, how?
Not really. Think about it.


Quote:
* Are there any systems out there implemented in this way that I could
examine for research, open-source or not?
If I am right about the universal relation thing, this article from 1988
mentions two: http://portal.acm.org/citation.cfm?id=624712


Reply With Quote
  #3  
Old   
Tegiri Nenashi
 
Posts: n/a

Default Re: Database which allows object to be "child" of any other object - 04-09-2009 , 02:40 PM



On Apr 9, 9:37*am, kuronekoy... (AT) gmail (DOT) com wrote:
Quote:
I'm working on a database-driven project and I'm trying to do some re-
architecting of the system.

I would like to cut down on the number of strictly-defined complex
object types, instead forming them from a composition of attached
atomic metadata objects. *
I understand that "metadata object" is "object in RDBMS dictionary".
The latter is just a table, correct?

I'm not quite sure what "strictly defined" means. Also what are
"complex object types", the structures composed of complex numbers?

Quote:
A user could have an attached phone number,
an attached address, an attached photo; but furthermore, an address
could have an attached photo or phone number.
Here is my revolutionary contribution to entity-relation theory. If a
table has "photo" column, that's an entity. It is relationship,
otherwise. Wait a minute "marriage" can have photos attached too, so
never mind.

Quote:
This means that in the DB, my relationship cannot be simply from the
"PhoneNumber" table to the "User" table. *It must allow relationships
from each metadata table to, potentially, every other metadata table.
This **could** be done using n^2 association tables for each parent/
child combination of metadata tables, but that would suck major donkey
balls. *It could also be done by having a generalized association
table which specifies both the table *and* the key of the parent and
child in the relationship, but I can think of no way to set up
automatic referential integrity checking when doing this.
Ok, I missed april 1st by quite a margin, so I suggest you approach
your problem from slightly different angle. This of the following
queries "find all the users by the phone number", "find all the users
at the specified address", ... Are they easily expressible in your db?
Are you actually getting any benefits abandoning traditional database
design?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.