From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: Nick Thurn Subject: Re: What is wrong with OO ? Date: 1997/01/01 Message-ID: <32C9D022.1329@aus.deuba.com>#1/1 X-Deja-AN: 207040281 references: <5aa73v$p14@news3.digex.net> <5aae85$ad8@masters0.InterNex.Net> content-type: text/plain; charset=us-ascii organization: OzEmail Ltd - Australia mime-version: 1.0 reply-to: nick.thurn@aus.deuba.com newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng x-mailer: Mozilla 3.01 (Win95; I) Date: 1997-01-01T00:00:00+00:00 List-Id: Robert C. Martin wrote: > > In article <5aae85$ad8@masters0.InterNex.Net>, clovis@wartech.com wrote: > > > All we're really discussing is HOW to provide data structures and algorithms. > > > > There isn't a real paradigm shift until the basic model itself changes. > > All we're really talking about is how to represent the data structures and > > algorithms, that is, how to go about implementing them. > > The paradigm shift in OO comes about because of some very different > separation strategies. Prior to OO, data was accessed from data structures. > Any algorithm that needed that data had knowledge of the data structures. > In OO, this changes. Some algorithms are closely associated with > a data structure and have intimate knowledge of it. However, other algorithms, > that use the data within the data structure have no knowledge of the data > structure. They are isolated from the data through abstract interfaces. > When the data structure changes, these algorithms do not change. Moreover, these > algorithms can make use of many different kinds of data structures without > knowing it. > > Thus there is a fundemental change. We still create data structures, and > we still create algorithms. But in OO we also create interfaces that > separate some algorithms from some data structures. Then we must decide which > algorithms know about which data structures, and which should be kept separate. > It is that decision that is called OOD. > > If you don't believe that this is a fundemental paradigm shift, then consider > that this simple trick of separating algorithms and data structures creates > an equation that is quite different from Wirth's: > > program = Interfaces(algorithms,data_structures) > > Where the algorithms and data_structures are independent variables that > have no knowledge of each other, and the interfaces are the mapping functions > that bind the two together to create certain programs. > This may be true in generic programming but I think Frank is right in general. Encapsulation removes the unknown usage problem from a data structure, you can do this in many languages via opaque types. So you can control access and hence algorithms outside of OOP. The fact that this was not done more often is more an indication of sloppyness than a paradigm problem. Most classes I encounter *don't* separate algorithm from data structure. Currently OOP tends to look like: program = (algorithm1+data_struct1) + (algoithm2+data_struct2) + ... data_structX = algorithm+data_struct | data_struct So OOP adds a level of organisation over and above the fundamental activity. I don't think the fundamental activity has changed. Now the fact that 98% of *time* is spent in the organisation stage is another issue :-) Happy New Year, Nick (my opinions only)