Re: MX::Traits why can't traits be added with just new?

[email protected] (Nick Perez)
Newsgroups perl.moose
Message-ID <[email protected]>
On Wed, 14 Mar 2012 13:45:30 -0500
Jesse Luehrs <[email protected]> wrote:

> Yes. There's no expectation that ->new is the only way to create new
> objects, classes have multiple constructors all the time (this is
> common in pretty much any object oriented language, not just in
> Perl). These other constructors are typically just wrappers around
> the default constructor, but this is yet another reason to not shove
> all of this logic into the default constructor - it makes adding
> additional ways to create instances of your class even harder.


I wonder if we couldn't extend Moose::Meta::Method::Constructor to act
as a container of available constructors with the ability to toggle
which is considered the "default" constructor. 


-- 

Nicholas Perez
XMPP/Email: [email protected]
https://metacpan.org/author/NPEREZ
http://github.com/nperez
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.