Re: Mixing OO and DB
Date: 13 Feb 2008 20:26:49 GMT
Message-ID: <verbs-20080213211257_at_ram.dialup.fu-berlin.de>
ram_at_zedat.fu-berlin.de (Stefan Ram) writes:
>shirt.makeSelfClean()
Or,
shirt.wash()
. This is a noun (»shirt«) and a verb (»wash«).
Could one imagine a world where natural language linguistics become so prevalent in user interfaces (because they are so natural) that one day computers have a »verb« and a »noun« key?
This is the keyboard from the Apollo computer panel of 1969:
http://infolab.stanford.edu/pub/voy/museum/pictures/display/0-2-ApolloPanel.jpg
Commands looked like
»V21 N27E 10E«
http://www.ibiblio.org/apollo/
But is this object-oriented at all?
After all, a classical command like
cat tmp.txt
also has a verb and a noun.
Object-orientation starts when a single verb can be used metaphorically for multiple types of nouns and still has the same meaning (as a metaphor).
So,
textedit tmp.txt picedit tmp.pic binedit tmp.bin
is not object-oriented, while
edit tmp.txt
edit tmp.pic
edit tmp,bin
is object-oriented if »edit« selects the appropriate editor by the file type and can be extended to new types without the need to modify existing code.
So, object-orientation
0 - decouples verbs from noun types for metaphoric use, and
1 - splits verb source code units into separate units
for each noun type, so that they can be changed independently.
In SQL, there is something similar: One can apply the verb »SELECT« to any table, whether it is a base table or a view, even if the implementation of these two selections differs.
But this is only »object-based«, as it is sometimes called, because it fulfills only »0« (in some case). It can not fulfill »1«, because one can not extend verbs in SQL. (One can define views, but this are more like nouns.)
But one can imagine an object-oriented language in a database system, where base tables and views are objects and verbs can be defined for those. A relation can be regarded as the type of its elements (rows).
An object-oriented database operation:
for each customer c do sendPresentTo( c );
, where »customer« is a table containing customers of different types (men, women, and children) and »sendPresent« has a different implementation for each type of customer. Received on Wed Feb 13 2008 - 21:26:49 CET