[Tutor] tkinter events: <B1-Motion>

Zsíros Levente zslevi at sch.bme.hu
Sat Sep 2 22:34:47 CEST 2006


Well, I considered encapsulation as syntactical sugar.
And even prolog knows polymorphism, but I wouldn't call it OOP. (Yes, I 
know in a typless context polymorphism doesn't mean too much. And btw, 
if Python is a multi-paradigm language why doesn't support polygamy? :) )
Or maybe I'm wrong ...



Alan Gauld wrote:

>I just found this message (because Mike posted the tinyurl....)
>and couldn't resist responding...
>
>"Zsiros Levente" <zslevi at sch.bme.hu> wrote
>  
>
>>If we're talking about data hiding, let me ask: why Python doesn't
>>implement data hiding (I mean 'private' and 'protected')? I consider 
>>it
>>a very important OOP feature, because that makes OOP different from
>>structural programming.
>>    
>>
>
>This is a hot-button of mine...
>
>Why do you think data hiding is important for OOP?
>And in particular why do you think it differentiates
>OOP from structural techniques?
>
>Data Hiding was not part of the early OOP languages
>(Simula, Lisp and the first Smalltalks) it was introduced
>first by Smalltalk in (Smalltalk 74 I think) and it was only
>when C++ came out that all the public/private nonsense
>appeared, followed by protected in C++ v2.0
>
>Many OOP languages do not support data hiding, it is
>not necessary for OOP. Data hiding is supported in many
>structual languages like the Modula family and ADA.,
>but they are not OOP. (The concept was introduced by
>David Parnas in 1972 - long before OOP became popular)
>
>The point being that Data hiding is an orthogonal issue
>to OOP which relies on encapsulation and polymorphism.
>- Encapsulation(*) is the ability to treat the data and methods
>  as a single entity - an object.
>- Polymorphism is the ability for different objects supporting
>  the same protocol to react in different ways to the same
>  message.
>
>Inheritance is an optional extra but is usually required to
>implement polymorphism...
>
>(*)Some texts get data hiding and encapsulation confused.
>Encapsulation as originally applied to OOP is about joining
>the data and function together - so fundamental to OOP that
>some folks forget its even there as a feature!
>
>Data hiding is about making data available through an API.
>That API could be an object's protocol or it could be a
>module interface. It's usually a good thing to do, but not
>a requirement of OOP.
>
>Rant over,
>
>If anyone wants a more academic review oif the differences
>between data hiding (or more correctly, information hiding),
>encapsulation and abstraction see this white paper:
>
>http://www.itmweb.com/essay550.htm
>
>by Ed Berard.
>
>  
>



More information about the Tutor mailing list