Perl: the Markov chain saw | |
PerlMonks |
Re: [Moose] Critique request on my Moose design (anti?)patternby greengaroo (Hermit) |
on Jan 27, 2014 at 19:09 UTC ( [id://1072264]=note: print w/replies, xml ) | Need Help?? |
I use Moose a lot and can probably help you, but I'm not sure I understand your question. You said: ...needing "sub" objects regularly. What is a "sub" object to you? What I see in your code is that MyApp (My::App object) is an attribute of the "My" class. Is that what you call a sub object? Also: How do you deal with passing required attributes through? ... You mean through the "sub" object? If you want to pass your required attributes from the "My" object to the "MyApp" attribute, I recommend using a "lazy" attribute with a "builder". Try this (you can get fancy later):
It's much cleaner.
A for will get you from A to Z; a while will get you everywhere.
-- greengaroo
In Section
Seekers of Perl Wisdom
|
|