in reply to Moose handling of unwanted parameters

G'day glasswalk3r,

With only a prosaic description, I'm left trying to envisage what your code looks like. That visualisation could easily be wrong. With that caveat in mind, here's some suggestions.

Perhaps use the lazy option in your Moose constructor. Something like:

has connection_parameters => (lazy => 1, builder => ...);

Maybe you want a MakesConnection Moose::Role; potentially applied conditionally using one of the Moose::Util functions, e.g. apply_all_roles().

— Ken

Replies are listed 'Best First'.
Re^2: Moose handling of unwanted parameters
by glasswalk3r (Friar) on Dec 20, 2016 at 11:53 UTC

    Fear not, since the code is a free software. See the classes Siebel::Srvrmgr::Daemon and subclasses of it.

    I specially liked the Moose::Role suggestion, using only a method to indicate connection is required (because Siebel::Srvrmgr::Daemon::Offline - which is not on CPAN yet - doesn't require one). Do you mean to create an required attribute, didn't you?

    Alceu Rodrigues de Freitas Junior
    ---------------------------------
    "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill