Re: Mixing OO and DB
Date: Tue, 12 Feb 2008 20:48:47 -0800 (PST)
Message-ID: <ea9358b4-e2f6-4f29-bff4-4e7f889792e7_at_m34g2000hsb.googlegroups.com>
On Feb 13, 2:40 am, Bob Badour <bbad..._at_pei.sympatico.ca> wrote:
> Object classes are data types. Object instances are data variables.
> Object values are data values.
>
> In general, objects are data.
In the following, object means object instance, and class means object class.
AFAIK Bob subscribes to the definitions of variable, value and type described by C.J. Date.
Accordingly a variable is something that can be assigned a value. In the following C++ code
void foo()
{
int* p = new int;
}
Bob would say there are *two* variables - a pointer named p on the frame, and an (unnamed) heap allocated int variable.
I think in Bob's view, we have some reasonably clear terminology here (type, variable and value), so why would anyone want to come in with all these silly terms like 'object' or 'class'.
However Bob makes a serious blunder here. He doesn't seem to realise the fact that many objects do not actually represent a variable that can be assigned a value. ie only a subset of classes can be deemed value-types (or just types as Date describes them).
Here are some examples of classes that are value-types:
Point, Rectangle, Circle, String, Matrix, TriSurface, Colour
Here are some classes that aren't
Thread, ThreadPool, Mutex, TextButton, PrinterProxy
Bob's confusion between the concepts of object state versus object value also leads him to misunderstand the significance of encapsulation in the context of OO. Received on Wed Feb 13 2008 - 05:48:47 CET