[Catalyst] Polymorphism?

J. Shirley jshirley at gmail.com
Tue Jul 7 13:41:58 GMT 2009


On Tue, Jul 7, 2009 at 6:11 AM, Eric Wright <info at rapidsynergy.com> wrote:

> Thanks all for the thoughts and the link. I'll be sure to take some time
> and digest that.
>
> Re: method modifiers, that sounds like a really interesting solution. Rol=
es
> seem very similar to me to Java interfaces. I really need to get more on
> board with understanding how Moose can best be utilized. I'm still very
> green. Plus the proliferation of object frameworks in Perl can leave you
> with analysis paralysis but things seem to be moving more that way in the
> Perl community especially with Perl 6 (somewhere?) on the horizon.
>
> I've got the new Apress Catalyst book on pre-order. Any other recommended
> reading resources?
>
> Cheers,
> Eric
>

I'm going to be very opinionated for a moment, so the TIMTOWDI crowd can
skip this message.

Don't bother with other object frameworks.  They really lack what makes
Moose special.  Moose is built on top of Class::MOP.  That's the meta-object
protocol which enables you to have a meta-layer and change the entire API
that Moose itself builds on.

This lets you do a tremendous amount of things with usually very little
code.  The learning curve is also not quite as steep as you would expect.

Here's an anecdote to prove my case ;)

The other day I wanted to update the behavior of an attribute.  Someone
pointed out "attribute trait".  I looked it up in the cookbook, and I was
able to get exactly what I wanted by changing the definition of what that
attribute was.  By changing the definition of things, you can change what
the instances of those things are very easily.  Unfortunately my case was
thwarted by some other things, so it didn't work exactly as intended... but
it will :)

Unless you have experience with Lisp or the like, you're not going to
initially appreciate what Moose is.  You'll think of it as a heavy-weight
object API, but trust a random guy on the internet when he says it is worth
it.

The manual is an easy read and worth following, and here is a good
presentation on Moose as well (lacks a little oompf without hearing Dieter's
voice): http://weftsoar.net/~hdp/moose/

Regarding books, I'd say venture out to your local Perl Monger meetings and
talk to them and borrow some of their books.  That way you can sample it,
and find out the books that speak to you and then you can purchase those.

Thanks,
-J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090707/4d92d=
97e/attachment.htm


More information about the Catalyst mailing list