Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Generic Modeling

Re: Generic Modeling

From: Brian Smith <brian-l-smith_at_uiowa.edu>
Date: 3 Jan 2002 15:07:31 -0800
Message-ID: <60360d48.0201031507.3d01ee65@posting.google.com>


jraustin1_at_hotmail.com (James) wrote in message news:<a6e74506.0201031125.57a1b251_at_posting.google.com>...

> I agree that almost anything in oodbs could be also be represented in
> rdbs. For simpler data structures and relationships, a rdb is perfect
> and preferrable. For more complex data structures and relationships
> oodbs has to do nothing special or different because its basic design
> allows such flexiblity from the start. To continue the above example,
> to represent all possible hierarchy/arrangements of the 100 objects
> one might need the following tables:
>
> T0, T1, T2, T3, T4, T5, T6, T7, T8, T9
> T0_T1_map

  ....
> T0-T9_map
> T1-T2_map
> T1-T3_map
> ....
> T9-T9_map
>
> unless you resort to a generic modelling within rdbs but then
> performance becomes a limiting factor.

See, when I started this thread, this was the exact statement that I wanted somebody to prove to be true or false for me. I don't see why this is necessarily true and I'd really like to know who's been doing research (preferrably published) in this area. I'm not arguing for the sake of arguing, I actually want to learn (that is what the "EDU" in my email address means).

> > First, 100 randomly arranged objects are not very useful.
> Maybe not but sometimes reality is that way and chaos is the norm not
> order

Are you using "random" in its dictionary meaning, or are you using it to mean "in arrangements that I cannot predict ahead of time". If you are using the dictionary definition, then I have the following argument: Maybe the "reality" as reified by our experience might be chaotic, but when modeling a system the developer's job is to reify "reality" in such a way that there is some useful order to it. I mean, show me a useful piece of code that reports on randomly arranged data? How can a person or individual benefit from this? This is a "data" vs "information" argument.

> They others may have "elaborate query optimizers" but still can't
> match the performance of XDb (www.xdb1.com/Benchmark) especially with
> complex/variable data. Is there a particular benchmark you would like
> to compare?

Actually, if anybody has a large amount of test data that has any kind of structure to it (preferrably with a lot of relationships between various objects, and many instances of many different classes), I would be interested in working with you to do a benchmark, although the results would hardly be definitive. I have written some Oracle9i code (very, very simple, as it is just a prototype for me) using the "THING" table approach that I would use in my tests.

> > Well, I think that generic modeling is best used to facilitate
> > meta-programming (automatic creation of programs) and "generic
> > coding". By "generic coding" I mean writing a small amount of (more
> > complex) generalized code that significantly reduces the amount of
> > relation-specific (class-specific) code you have to write. This is
> > orthogonal to the OODBMS vs. RDBMS argument.
>
> I agree that generic modeling facilitates "generic coding".
> And I find that it is easier to write generic code with XDb than with
> rdbs.
> For example, XDb implements the ability to instantiate/copy an object
> as simple as a nut to as complex as a battleship with all its
> dependent objects. The Instantiate/Copy/Paste buttons to do so appear
> in XDb's interface. The equivalent functions are available via the
> API. Where can I find these in Access, SQL Server or Oracle?

Well, in SQL you can "instantiate" anything with an INSERT statement, and you can "copy/paste" with an INSERT ... FROM ... statement. But I admit for complex structures you would need to use a hierarchial query or some procedural code. If you are talking about creating a row (object) of a table (class) without having created a specific table (class) to organize the data for the row (object), that is not an argument for a OODB instead of a RDB, but rather an argument for generic modeling (which you can obviously do in an OODB or an RDB).

> > I would say that an OODBMS has an advantage over an RDBMS when you are
> > using an OO programming language for logic AND your serialization
> > needs can be handled (nearly) transparently and efficiently by the
> > OODBMS. An RDBMS has the advantage
> > when your data has to be accessed by a non-OODBM system.
>
> XDb is not a serialization of objects in a oo programming environment.

Well, maybe my choice of the word "serialization" was poor as many people think of non-database persistance when it is used. At any rate, I will just retract the whole statement above about when which type of database has the advantage, as, the more I think of it, it isn't as clear-cut as my statement implies, and I have no time to compose a better one.

> > Futher, I don't doubt that a RDBMS could be built on top of an OODBMS;
> Agree.
>
> > similarly, I think that you could be an OODB system that stored
> > information in an underlying RDBMS.
>
> Could, but it would be difficult and slow since rdbs by design
> represent data using tables not objects. See above the difficult a rdb
> would have representing the 100 objects unless you resort to a generic
> tables in which case performance becomes a limiting factor.

You can't compare tables to objects. Keep in mind the following analogies:

     (object : class)
  :: (tuple  : relation)
  :: (row    : table)

Also, please show me some evidence of limiting performance of the generic approach.

> Exactly, this can be done in an rdb when representing data in a few
> tables (aka generic modelling) but the performance is poor in
> comparison to XDb. If you are ready, we can try the "THING" table vs
> XDb on a battleship and compare the difference in flexibility and
> performance.

Please, lets do this.

> > RDBMS vs. OODBMS is orthogonal to generic vs. hand-coded.
> I you mean that an oodb results in more hand-coding, I would disagree.

No, I'm saying something completely different: the argument between RDBMS and OODBMS systems is completely seperate from the argument of generic coding vs. hand-coding, unless somebody can prove otherwise. So, I'm definitely not saying that use of an OODBMS results in more hand-coding.

> Why is XDb able to instantiate complex classes?
> (www.xdb1.com/Basics/ClassComplex.asp)
> (www.xdb1.com/HowTo/CreateObj.asp)
> Because it is easier/possible to create the generic code for it.

We shall see. The prototype system I have been playing with is not so different from XDb (at least, by looking at these examples), So it should be a fair comparison. I can let you use my DDL scripts and you can download Oracle9i for free from otn.oracle.com.

> I submit because it is difficult/impractical to do in a generic manner
> in rdbs (unless you resort to generic modelling of data).
> Why is XDb able to copy any complex data structure?
> Because it is easier/possible to create the generic code for it.

Again, nobody here has shown definitively why generic modeling of data in an RDB isn't good enough.

Thanks,
Brian Received on Thu Jan 03 2002 - 17:07:31 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US