YADTR (Yet Another DateTime Rant)
steve+comp.lang.python at pearwood.info
Fri Mar 28 15:35:15 CET 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
> And, no, I
> don't think inheritance is a fundamental characteristic of OOD, nudge
That's not representative of what most people, and specifically
most computer scientists, consider fundamental to OOP.
It's difficult to pin-point exactly what characteristics of OOP are
fundamental, but inheritance is surely one of them.
More information about the Python-list