in reply to Package shortener and loader
And the code is non-magickal:my $instance = $self->gnew(LastPartOfLongPackageName, @args_to_constructor);
package XML::Quickbooks::Util; # ABSTRACT: various utility functions use Moose::Role; sub gnew { my($self, $pkgtail, @constructor_args)=@_; use Class::MOP; my $class = "XML::Quickbooks::Generator::$pkgtail"; Class::MOP::load_class($class); $class->new(@constructor_args); }
-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"
|
|---|