Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Does one encapsulate a class from itself?

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
  • Comment on Re: Does one encapsulate a class from itself?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://672523]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2026-01-16 13:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (118 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.