Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
5 - Have a role that all three modules do
The role says which methods have to be implemented and can contain the common behaviour. If you don't use Moose or Moo, you can still use Role::Tiny. The Factory pattern was the first thing that came to my mind. At work, we are using it a lot (with Moose) and it makes the code much simpler and the relations between classes more explicit. In fact, the Bod::Social in example 3 already is kind of a factory class. See also design-patterns.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In reply to Re: Designing multiple related modules
by choroba
|
|