On Mon, Oct 12, 2009 at 3:22 PM, Yuri Shtil <yu...@juniper.net> wrote: > Chris Prather wrote: >> >> On Mon, Oct 12, 2009 at 12:11 PM, Yuri Shtil <yu...@juniper.net> wrote: >> >>> >>> Hi, >>> >>> Have anyone tried to use Aspect >>> <http://search.cpan.org/%7Eadamk/Aspect-0.21/lib/Aspect.pm> with Moose >>> classes? >>> >> >> I suspect other than the subroutine collision on before/after it >> *should* work. Specifically I haven't heard of anybody who's been >> using them together. Moose's built in tools tend to be enough for most >> people (Roles, Delegation, Method Modifiers, Explicit MOP). >> >> That said, I've found over the last decade that AOP doesn't really >> solve more problems than it creates.You end up with a *ton* of action >> at a distance and difficult to follow code. Separation of concerns is >> good, and Moose provides a lot of built in tools to do it (see above) >> but it's one tool in the box and not always the most useful tool if >> your goal is communicating with other programmers. >> >> -Chris >> > > If I understand your reply correctly, it is possible to implement all/most > Aspect goodies using Moose, but it would be a hard sell to others.
Not really when you consider that the people behind AOP are also the people that wrote the books and papers about the Meta Object Protocol. What I think I'm suggesting is that the things I personally found useful about AOP, I get for free with Moose. Specifically that is the ability to dissect my code into re-usable components that reflect discrete concerns leaving my business logic exposed with very little of what Ovid recently called "Synthetic Code". The canonical examples I remember from when I last looked at AOP were "Logging" and "Storage", and I point to MooseX::Log::* modules and MooseX::Storage and KiokuDB as perfect examples of how Moose can solve these these using separated concerns. -Chris