I'm not using Moo(se) but this looks like you are changing the interface after reload.

Obviously (for me) you must respect the contract, when replacing code in a live system.

Regarding data, there is a reason why languages like Haskell require their functions to be "pure", i.e. to have no side effects or inner states.

Regarding Perl modules, a reload would need to handle not only functions, but also with package variables being used outside the module and/or lexical closure variables carrying state.

I could think of a solution with a proxy module shadowing all this, but this l also depends on the concrete requirements.

And practicality is different for development and production scenarios..

Last but not least, I can't really comment on OO frameworks. If their inner workings make it impossible to make data persistent, there is not much which can be done.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery


In reply to Re^2: Refresh a Module by LanX
in thread Refresh a Module by Timka

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.