YADTR (Yet Another DateTime Rant)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Mar 28 10:35:15 EDT 2014


On Fri, 28 Mar 2014 08:30:11 -0400, Roy Smith wrote:

> In article <533558fa$0$29994$c3e8da3$5496439d at news.astraweb.com>,
>  Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:
> 
>> > Yes.  The whole idea of OOD is to decouple internal representation
>> > from external behavior.
>> 
>> The *whole* idea? You don't think that encapsulation and inheritance
>> might also be involved? *wink*
> 
> I'm not sure how "decoupling internal representation from external
> behavior" is substantially different from encapsulation.

They are mostly unrelated. In the first, you're talking about information 
hiding. The second, encapsulation, relates to the bundling of code and 
data, optionally in such a way as to restrict or control access to some 
or all of the encapsulated data.

Encapsulation can be used as a mechanism for information hiding, but need 
not be.

https://en.wikipedia.org/wiki/Encapsulation_%28object-oriented_programming%29


> And, no, I
> don't think inheritance is a fundamental characteristic of OOD, nudge
> nudge.

That's not representative of what most people, and specifically 
most computer scientists, consider fundamental to OOP.

https://en.wikipedia.org/wiki/Object-oriented_programming#Fundamental_features_and_concepts

It's difficult to pin-point exactly what characteristics of OOP are 
fundamental, but inheritance is surely one of them.



-- 
Steven D'Aprano
http://import-that.dreamwidth.org/



More information about the Python-list mailing list