Moose does not attempt to solve this, mostly because we see it as a social problem rather then a technical problem.
If a co-worker writes code that accesses the underly HASH ref then they are breaking encapsulation (as well as general community coding standards). Once you discover this violation, you should talk to that person and explain why they shouldn't do it. If said co-worker continues to do this, then they should likely be fired or at least disciplined.
Encapsulation is just a concept, something you can use to help write better code with. Encapsulation is not about completely preventing access to slots, but about providing clean and controlled ways to access slots. Moose accessors provide exactly that, a clean, consistent and controlled way to access your object's slots. What Class::Std (and all the other Inside-Out object systems) do is really just obsfucate slot access, an enterprising hacker can easily get past that encapsulation using modules like B and PadWalker.
... can you mix Moose and Class::Std?
Not at all, they are two conflicting systems.
In reply to Re^3: Moose or Mouse for production use
by stvn
in thread Moose or Mouse for production use
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |