develooper Front page | perl.perl5.porters | Postings from March 2011

Re: Revising Perl's OO docs - a new OO tutorial

Thread Previous | Thread Next
From:
Chris Prather
Date:
March 7, 2011 16:39
Subject:
Re: Revising Perl's OO docs - a new OO tutorial
Message ID:
AANLkTi=BVDuopOad3imt8GBCQWLOm=zOTKnp67Ti=87a@mail.gmail.com
On Mon, Mar 7, 2011 at 7:09 PM, Paul Johnson <paul@pjcj.net> wrote:

> What is being discussed here is the "Uniform Access Principle".  Its
> purpose is specifically to ensure that encapsulation is *not* violated.
> See http://en.wikipedia.org/wiki/Uniform_access_principle

Yes exactly. I hadn't seen this page before, or had forgotten about
it. It also falls out of Liskov, the Law of Demeter, and basically any
argument for strong encapsulation. This also clarifies where Ric was
going with the Ruby reference. I had not known it strongly protected
instance variables, thought I am unsurprised.

> Perl6 was going to support it, and I believe it now does:
> http://www.mail-archive.com/perl6-language@perl.org/msg09420.html
>
> I would love to have a core OO system which supported this principle.

One of the reasons I like Moose is that it tries to make this easier
rather than harder for more than just attribute-slot access*.

-Chris

* This is not an argument to core Moose, just a comment on what I like
about it's tendencies.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About