Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: OO concepts and relational databases

by Solo (Deacon)
on Aug 02, 2004 at 20:24 UTC ( [id://379417]=note: print w/replies, xml ) Need Help??


in reply to Re: OO concepts and relational databases
in thread OO concepts and relational databases

The only real common data relation shared between OO and relationnal data model is the association. The two other one may be more or less emulated with frustrating results and poor performance as other monks have already pointed out in this thread.

Relational models often include 'IS A' relationships for many of the same reasons OO designs do. Supposing you have a table Vehicle, you might need tables Truck and Motorcycle to hold information specific to only some of the rows in Vehicle. This is commonly modeled as a 1 to 0 or 1 relationship between the generic table and the specific table, but other implementations are possible. My results have never been frustrating, and performance is not generally a factor in this design choice.

--Solo
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re^3: OO concepts and relational databases
by dfaure (Chaplain) on Aug 02, 2004 at 20:54 UTC
    Supposing you have a table Vehicle, you might need tables Truck and Motorcycle to hold information specific to only some of the rows in Vehicle.

    You're describing here a design rule able to emulate an heritage, which is mostly a matter of methodology/dba experience.

    With a (real) OODBMS, this kind of trickery relational modelisation is not required.

    ____
    HTH, Dominique
    My two favorites:
    If the only tool you have is a hammer, you will see every problem as a nail. --Abraham Maslow
    Bien faire, et le faire savoir...

      You're describing here a design rule able to emulate an heritage, which is mostly a matter of methodology/dba experience.

      With a (real) OODBMS, this kind of *trickery* relational modelisation is not required.

      Well and good to use an OODBMS if one is within your options. I make no assertions about whether an RDBMS or OODBMS is more appropriate.

      However I will not allow it to be said RDBMS do not support ISA relationships, when they are clearly supported and the relationship follows directly from normalization. It is not trickery, nor even unusual.

      Update: Removed inflammatory language that was not meant to be so.

      --Solo
      --
      You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
        However I will not allow it to be said RDBMS do not support ISA relationships, when they are clearly supported and the relationship follows directly from normalization.

        Wrong. That is completely and utterly wrong. RDBMSes support HAS-A relationships, in that a lineitem record HAS-A invoice record that it is on. Set theory (which RDBMSes are based on) is all about HAS-A relationships. The only IS-A relationship is the relationship between the specific record and the table it lives in. The person you are attempting to lay the smack-down is absolutely correct.

        You might do well to rethink exactly what an IS-A relationship is vs. a HAS-A relationship and how normalization works with that.

        ------
        We are the carpenters and bricklayers of the Information Age.

        Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

        I shouldn't have to say this, but any code, unless otherwise stated, is untested

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://379417]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2024-03-28 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found