Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
We are handling similar problems at the moment.

First of all you are dealing with a OO class, so there are even more options available.

In our case the main author created a very large module with a lot of cross dependencies, and other can't discuss it anymore with him.

To make it clearer, if Foo::Bar::_aa() is calling Foo::Blabla::_bb(), i.e. both are refactored into different modules you need to adjust the call to &_bb() too.

IF all your calls so far where ->method calls, you could try to import them into the main class Foo, before the first code is run.

This is very close to OO concepts named roles, mixins, traits , ...

But our case was more complicated, because we have also function calls.

So I convinced the maintainer to adapt a "evolutionary" low-level approach and to just move the functions in logical groups into several _Foo::Whatever "modules" but all belonging to "package Foo;" and to requiring them at compile time from the top-module (aka use without import).

Like this can freely move stuff into sub-files without fearing any conflicts (NB: there are no filescoped lexicals in this file)

This helps us to get an overview over the stable product and discuss necessary refactorizations on parts of the application. (Divide and Conquer)

The goal is of course to have proper sub-modules/classes in the end.


Of course, like already said, if your case is less complicated and all your calls are ->method calls, try as I told you and import _aa() from Foo::Bar into Foo::

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

In reply to Re: Breaking up a big module (low tech require same namespace) by LanX
in thread Breaking up a big module by talexb

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, 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, 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.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (5)
    As of 2019-08-21 15:32 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found