On Wed, 9 Apr 2014, Thalhammer, Jeffrey Ryan wrote:

So I find myself building my own factories to do the wrapping for me.
Architecturally, I think it makes sense.  And I like using curries to
pass extra state into the wrappers.  But it sure requires a lot of code.

I wonder if there is a more succinct way to do this.  I want to say something like 
"for classes
X, Y, and Z, always turn them into My::X and My::Y and My::Z using the interfaces 
that I want."

Does that make any sense?

Have you considered a configuration-driven appoach, so you could declare 1 
Factory class and then configure it appropriately (with a config file, or 
on-the-fly construction args), to perform all of the different types of 
encapsulation that you could ever need to do, now and in the future?

I'd then consider distilling this behaviour down into a Moose::Role, for any 
Class to consume.

--
Niall Young
ni...@iinet.net.au

Reply via email to