Loading ...
Sorry, an error occurred while loading the content.

295Re: Mixins (was: Re: [extremeperl] Better Development Tools for Perl)

Expand Messages
  • Perrin Harkins
    Jun 6, 2005
      On Mon, 2005-06-06 at 12:06 -0400, Adam Turoff wrote:
      > The real benefit of mixins is that code works in a more aspectish
      > manner.

      It makes sense; I just think the implementation is lacking. It's
      supposed to be a workaround for the problems with adding functionality
      through inheritance, but I think there has to be a better way.

      > Of course, mixins can be abused, leading to action-at-a-distance

      Yes, action-at-a-distance is the core problem with most of the stuff I
      was whining about.

      > I would argue that these corner cases you describe are an abuse
      > of mixins, and are a funky-mixin codesmell that is a signal that the
      > entire system needs a refactoring or two to return to a simpler state.

      Judge for yourself. Most of them look like this:

      sub import {
      my $class = shift;
      my $pkg = caller(0);
      croak(__PACKAGE__." is for Class::DBI application.");
      no strict 'refs';
      *{$pkg."::some_method = sub {

      - Perrin
    • Show all 107 messages in this topic