Re: Clean Object Class Design -- What is it?

From: Bob Badour <bbadour_at_golden.net>
Date: 23 Jul 2001 18:03:50 -0700
Message-ID: <cd3b3cf.0107231703.54d0a6b9_at_posting.google.com>


> > > > If OIDs provide the equivalent of logical identity and the system does
 not
> > > > expose the OID, how do users differentiate among objects with the same
> > > > value?
> > >
> > > if(object1 == object2){
> > > }
> >
> > If the OID (or some other pointer) is not visible to the user, how
> > could the test ever fail when the object values are the same?
>
> ???
>
> The test can very well fail:
>
> Person bob1 = new Person("Bob");
> Person bob2 = new Person("Bob");
> if(bob1 == bob2)
> // will return false
>
>
> A similar example comparing the results of two queries:
>
> ObjectSet results = db.get(new Person("Bob"));
> while(results.hasNext()){
> Person bob1 = (Person)results.next();
> ObjectSet compare =
> db.get(new Person("Bob Badour"));
> while(compare.hasNext()){
> Person bob2 = (Person)compare.next();
> if(bob1 != bob2){
> System.out.println("Not all Bobs are Badour.");
> }
> }
> }
>
> Where are OIDs or pointers in the above example?

On either side of the '==' and '!=' operators, which clearly operate on pointers.

> > > Which object databases have you been experimenting with and when? You
> > > provide us with so many false statements
> >
> > You, Carl, are the one who makes false statements. I have identified
> > scores of them, and I have explained how the statements are false. You
> > cannot point to a single false statement I have made and explain why
> > it is false! How is that for a challenge?
>
> Some of the false statements that you have posted:
> False 1: Relational databases are object databases.

You have not explained why it is false, while I have repeatedly explained why it is true:

It is true because relational domains are object classes, tuples are sets of object values, relation values are sets of sets of object values and relation variables are sets of sets of object variables.

> False 2: Object databases expose pointers.

Again, you have not explained why it is false.

Your own example above demonstrates that the non-relation object databases do expose pointers. Both the '==' and '!=' operators in your example operate on pointers.

If the only thing that distinguishes two object variables is an OID, the user could never distinguish them unless the DBMS does expose the OID.
> False 3: Object databases do not have performance advantages.

Again, you have not explained why my statement is false. I have repeatedly explained why it is true:

The relational model determines only how the DBMS represents data to the user and not how the DBMS stores the data. Since the DBMS can store the data identically to a non-relation ODBMS, it can achieve equivalent performance.

> False 4: Object databases add complexity in handling objects.

I have never made the above statement. Please do not put words in my mouth. I am quite capable of doing that on my own.

I have claimed that non-relational ODBMS add complexity to the logical interface to objects, and I have repeatedly explained why and how they add this complexity.

> > > > > How does your "mapping objects to columns" (domains) approach take
 care
> > > > > of object identity?
> > > >
> > > > Logically and correctly -- by using candidate keys.
> > >
> > > How would those keys be represented in objects?
> >
> > Some object variables/values provide identity for other object
> > variables by identifying tuples. However, once we have established the
> > identity of an object variable, we do not need to internally represent
> > the identity.
> >
> > Your question equates to: How does Java represent variable names in
> > objects?
>
> No.
>
> Identity is a concept present in the programming language. If the database
> engine ensures single instantiation of stored objects, it persists the
> identity concept of the language. No exposed keys are needed.

You have denied that your question equates to: "How does Java represent variable names in objects?", but you have given no explanation for how your question differs.

You then continue with an explanation that Java does not represent variable names in objects, which is exactly what I have stated above about internally representing indentity.

> > > Please give an example.
> > >
> > > I have the following class:
> > > class Person{
> > > String firstName;
> > > String lastName;
> > > }
> > >
> > > How would your "mapping objects to columns" approach tell one "Bob
 Badour"
> > > apart from the other?
> >
> > Given your design above, how would your users tell one "Bob Badour"
> > apart from another?
>
> if(person1 == person2)
> ...as I have stated above.

I am not asking how Java evaluates the pointers or OIDs. I am asking how actual human users will tell one "Bob Badour" apart from another.

> Again:
> How would your "serialize objects to columns" mechanism tell two objects
> apart?

That is not my approach. Columns contain actual objects and require no "serialization". Received on Tue Jul 24 2001 - 03:03:50 CEST

Original text of this message