Re: SQL
On 31 Jan 2006 19:36:38 -0800, topmind wrote:
> Dmitry A. Kazakov wrote:
>> There are many clean and consistent things, which lead to a total mess when
>> used inappropriately. DB applications represent an excellent example.
>
> True, but OO has no consistent "right way".
As well as programming in general.
> Relational normalization is
> driven pretty much by avoiding duplication (at least the first 3
> "laws"). OO tends to duplicate interface patterns such as add, change,
> delete, sort, etc. for each class. It does not factor similar "database
> verbs" into one spot, replicating them per class (with "creative"
> twists for each personality). And many-to-many in OO often results in
> two-way pointers.
The difference is between one type and multiple types. Relational model
deals with *one* class: table. OO tries to handle more than one class.
Consider tables of types instead of tables of objects, and we'll see if
that will be any simpler.
>>> Yes, mass repetative verbose static Set/Get's.
>>
>> There are bad languages, which don't fully implement ADT. So?
>
> Converting attribute-driven interfaces into ADT's is still pretty much
> Set/Get.
They implement attribute access. It is up to the language to provide
X.Attribute notation rather than nasty X.Get_Attribute. I don't see any
problem here.
>> What about inserting when no
>> row exists and updating otherwise?
>
> MySql has a command just for this.
The advantage of ADT is that you can define that command and provide an
implementation for. SQL does not have proper ADT, otherwise people would do
higher-level programming directly in SQL. The methodology of higher-level
programming is OO.
>>>>>> Similarly, just because different object-oriented programming languages
>>>>>> may have problemsinteroperating with each other's objects, isn't a failing
>>>>>> of object-orientation.
>>>>>
>>>>> Non-OOP protocols are usually easier to share.
>>>>
>>>> True, when they are low-level.
>>>
>>> I disagree. Please justify.
>>
>> Consider machine code as a protocol. Why would you like to have any
>> programming language instead?
>
> I don't know what you are implying. Perhaps an example would help.
Isn't machine code a simple communication protocol to CPU? You send the
code of MOV and CPU does that. Simple? Can you handle it without a
compiler? Protocol must match the complexity of what you want to tell to
the receiver. Simplicity alone isn't an advantage.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.