Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Personally, I think that going for this kind of hard encapsulation is self-defeating. The whole point of OOP is to decouple your code. If your colleague is violating this decoupling, then it is incumbent upon you to educate your colleague. Education is better done non-coercively. If your colleague refuses to learn, quit. Life is too short and, despite the general slowdown, the jobs are out there.

If you're providing a module for general consumption, you don't have to do B&D development. This is not consistent with the culture of the entire LAMP model. If someone abuses your appropriately-documented interface, that's their problem, not yours. It's your job to make your stuff mistake-proof, not fool-proof. Fools are infinitely more cunning than any of us can ever be.

Now, this form of implementing flyweight objects is flyweight only in the creation and memory usage (and if you're using stringification of hashrefs as your index, you don't even have that benefit).

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.


In reply to Re: Encapsulation through stringification - a variation on flyweight objects by dragonchild
in thread Encapsulation through stringification - a variation on flyweight objects by robartes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-03-29 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found