Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Serialization via Data::Dumper or Storable seems to be the Achilles Heel of all of the inside-out implementations. It seems to me to be a Very Bad Thing(TM) that, by default, including a reference to almost any inside-out object in a larger data structure results in a data structure that cannot be serialized.
I find that assuming that if you "walk the reference recursively, remembering everything you find" you have reliably serialized your object a very shaky way of programming. I'd never, ever make such an assumption for code that was important.

If I have the need to serialize objects, their classes shall have store/retrieve methods, whether they have been implemented with inside-out objects, hash-based objects, or something else. Anything else just stomps all over encapsulation, and results in code that doesn't deserve to be checked into source control.

And, of course, fixing that would require making it possible to break encapsulation via manipulation of the serialized instance - thus defeating the raison d'être of inside-out objects.
No. The point of inside-out objects isn't to prohibit messing with the internals. The point of inside-out objects is two-fold: preventing accidental messing with the internals, and giving you all the benefits of use strict.
I also severely dislike the use of 'lexical globals' inherent in them. It makes anything using them difficult to make completely thread-safe.
I do not know what 'lexical globals' are. And I don't think that inside-out objects are anyway less thread-safe than hash based objects are. (Now, certain modules claiming to do inside-out objects may not be thread safe).
Perl --((8:>*

In reply to Re^2: Seeking inside-out object implementations by Perl Mouse
in thread Seeking inside-out object implementations by xdg

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 drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-29 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found