|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
Re: Does one encapsulate a class from itself?by herveus (Prior) |
| on Mar 06, 2008 at 17:48 UTC ( [id://672523]=note: print w/replies, xml ) | Need Help?? |
|
Howdy!
I think your analysis is pretty well spot on. If you severely limit the place where your code relies on the underlying storage mechanism, you have less code to change when you decide to redo that mechanism. Changing from a "classic" hash-based object to an inside-out object may be a bit contrived, but adding a persistent backing store such as a database would be a plausible case. You might even go so far as to create a class to be the raw object distinct from the main class that is the public interface.
yours, Michael
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||