I have a module A which has multiple features B, C, D, because multiple people will work on these and it would be nice to have this logical separation of the different features.

That's not the way you should design object-oriented code.

You should find useful abstractions based on how they interact with each other, not by who develops them.

It's not making use of any OO concepts

That might be an indicator that you don't actually need any OO - how about just a hash with objects B, C, D? Or a sub that returns those objects, based on the argument you pass to it?

The existence of shiny OO tools don't mean you have to use them for every case.

What doesn't your current solution do that you might want from it? Extensibility? You can still stick other objects in the attributes if you make them writable (a hash provides that by default).

sub another_method { my ($self) = @_; $self->a->exec(...); # Stuff related to C }

Looks like delegation would make your life easier here.

But in general it is very hard to give advise based on such general descriptions. It could be anything from "Don't use OO at all" to "use delegation" or "use roles" or "stick with your current approach" - we just don't have enough context to decide.


In reply to Re: Moose design question by moritz
in thread Moose design question by elTriberium

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.