I am looking for some assistance choosing a good module name for a class
that I would like to build. Essentially it would perform a similar
function to Moose::Util 'with_traits' or MooseX::ClassCompositor. The
major difference in my offering would have a different user interface. I
am thinking of the following possibilities.
MooseX::Util::ClassBuilder
MooseX::ClassBuilder
MooseX::Shiras::ClassBuilder
I noticed that many MooseX modules have Util in the third position but
there doesn't seem to be a MooseX::Util branch of the namespace yet?
> I am looking for some assistance choosing a good module name for a class
> that I would like to build. Essentially it would perform a similar
> function to Moose::Util 'with_traits' or MooseX::ClassCompositor. The
> major difference in my offering would have a different user interface. I
> am thinking of the following possibilities.
> MooseX::Util::ClassBuilder
> MooseX::ClassBuilder
> MooseX::Shiras::ClassBuilder
> I noticed that many MooseX modules have Util in the third position but
> there doesn't seem to be a MooseX::Util branch of the namespace yet?
> Any suggestions are welcome.
> JANDREW
> Jed
Jed,
Might be helpful if you pointed us at some code.
Personally I am not a fan of MooseX::Util as a namespace, the idea behind MooseX:: is that it provides extension to Moose itself, and MooseX::Util reads to me as "utilities to help build extensions of Moose", which is not what your module sounds like.
stevan.lit...@iinteractive.com> wrote:
> On Oct 5, 2012, at 3:04 PM, Jed Lund wrote:
> > All,
> > I am looking for some assistance choosing a good module name for a class
> > that I would like to build. Essentially it would perform a similar
> > function to Moose::Util 'with_traits' or MooseX::ClassCompositor. The
> > major difference in my offering would have a different user interface.
> I
> > am thinking of the following possibilities.
> > MooseX::Util::ClassBuilder
> > MooseX::ClassBuilder
> > MooseX::Shiras::ClassBuilder
> > I noticed that many MooseX modules have Util in the third position but
> > there doesn't seem to be a MooseX::Util branch of the namespace yet?
> > Any suggestions are welcome.
> > JANDREW
> > Jed
> Jed,
> Might be helpful if you pointed us at some code.
> Personally I am not a fan of MooseX::Util as a namespace, the idea behind
> MooseX:: is that it provides extension to Moose itself, and MooseX::Util
> reads to me as "utilities to help build extensions of Moose", which is not
> what your module sounds like.
How is this any different than what Moose::Meta::Class->create() (and create_anon_class) provide?
All your code does is reimplement that, AFAICT.
-dave
/*============================================================
http://VegGuide.orghttp://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless)
============================================================*/
I agree the differences are minor. However, In my mind the differences are
valuable if possibly more style based.
I wrap two changes around Moose::Meta::Class->create in my proposal. I
accept named hash value pairs for everything including a new package name
where ->class() expects the new name as the first argument. Second I have
an instance creation method that leverages the class creation method. I
just noticed that it is not included on the PrePAN synopsis These two
changes allow me to do two things. First since all arguments are named
arguments they can either be omitted or provided with no code failure.
Meaning I can create an anonymous class with the same function as a named
class by just omitting the key/value pair for the name. Second, the class
function is set up to pass through instance arguments that are composed as
a hash without touching them. This makes it possible to bundle the
necessary arguments for an instance with the arguments for a completely new
class and create the instance without using the following syntax.
I understand that both issues are style based and are not intended to
reflect on Moose or its excellent implementation, but I find the previous
syntax a bit clunky and it occurs a fair amount in code I am writing now.
As a consequence I am looking for an out of the way namespace to place a
class I can use to modify the instance implementation syntax to a 'method(
%args )' style.
> How is this any different than what Moose::Meta::Class->create() (and
> create_anon_class) provide?
> All your code does is reimplement that, AFAICT.
> -dave
> /*============================**==============================**==
> http://VegGuide.orghttp://blog.urth.org > Your guide to all that's veg House Absolute(ly Pointless)
> ==============================**==============================***/
On Mon, 8 Oct 2012, Jed Lund wrote:
> I wrap two changes around Moose::Meta::Class->create in my proposal. I
> accept named hash value pairs for everything including a new package name
> where ->class() expects the new name as the first argument.
Actually, Moose already accepts key/value pairs for this method, but this is documented (this thing with multiple calling styles is something I really hate in the Moose core).
Most (but not all) methods of the ->method( $name, %args ) style also work with ->method( name => $name, %args ). Substitute the "name" key for "package" or whatever is appropriate.
Anyway, calling this MooseX::Util::ClassBuilder seems kind of weird since Moose already has plenty of class building support.
It's more like MooseX::ShortCut::BuildClass or something.
-dave
/*============================================================
http://VegGuide.orghttp://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless)
============================================================*/
On Mon, Oct 8, 2012 at 8:49 AM, Dave Rolsky <auta...@urth.org> wrote:
> On Mon, 8 Oct 2012, Jed Lund wrote:
> I wrap two changes around Moose::Meta::Class->create in my proposal. I
>> accept named hash value pairs for everything including a new package name
>> where ->class() expects the new name as the first argument.
> Actually, Moose already accepts key/value pairs for this method, but this
> is documented (this thing with multiple calling styles is something I
> really hate in the Moose core).
> Most (but not all) methods of the ->method( $name, %args ) style also work
> with ->method( name => $name, %args ). Substitute the "name" key for
> "package" or whatever is appropriate.
> Anyway, calling this MooseX::Util::ClassBuilder seems kind of weird since
> Moose already has plenty of class building support.
> It's more like MooseX::ShortCut::BuildClass or something.
> -dave
> /*============================**==============================**==
> http://VegGuide.orghttp://blog.urth.org > Your guide to all that's veg House Absolute(ly Pointless)
> ==============================**==============================***/