You are right, thanks for pointing it out. You have the general problem that SUPER isn't guaranteed to pick up the right class with multiple inheritance.

True. There's always NEXT.

While I don't see reblessing as evil, (what is the big problem?)

I don't see re-blessing as necessarily evil, and there are odd places where I will use it. However in this particular instance I'd be worried that somebody reading:

$foo = Foo->new( $bar );

will really not be expecting $bar to be reblessed into a different class since 99.9% of new() methods do not do weird side-effecty things like that to their arguments.

We're comparing the solid Class::InsideOut with some not-yet-written counter-example of mine. I can wriggle out of any argument by redefining the example. For the moment, if you don't mind, I'd rather give it a rest until there is something more concrete to discuss. It's been instructive so far.

Of course I don't mind :-)

I think the issue is that Class::InsideOut has different design goals from the system that you want. It's been very deliberately (and nicely) designed to be minimal - so that it can be used in as many situations as possible. Whereas you seem to be talking about something more like Object::InsideOut or Class::Std which are aiming to solve a bigger/different set of problems.

There is absolutely nothing wrong with your goal of separating out initialisation from object construction. It's just that it's not a design goal for C::IO.


In reply to Re^12: Introducing Class::InsideOut by adrianh
in thread Introducing Class::InsideOut by xdg

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.