user-pic

Wayan

  • Commented on Moose-iplicity
    Sorry for typo. "k, no universally bad design" should be "Ok, no universally bad design"...
  • Commented on Moose-iplicity
    k, no universally bad design. Most of my comment comes from the fact that I am very much dependency injection oriented. For me the foo, bar are the dependencies of $thing thus they should be passed to it - most...
  • Commented on Moose-iplicity
    I strongly agree with John Napiorkowski above. Your "neat trick" leads to a very untidy design. You just created a single class which implements two very different, completely unrelated things: some unspecified action for which foo and bar are needed,...
Subscribe to feed Recent Actions from Wayan

  • Buddy Burden commented on Moose-iplicity

    Hi, JNap! Long time no speak; hope things are going well out your way.

    > You could more carefully separate it (and avoid tying yourself to Moose) but just having a factory method:

    Well, sometimes avoiding tying yourself to Moose is desireable. But, if you're already hitched up to Moose pretty tightly, rewriting features which Moose gives you for free can just give you even more code to worry about having to maintain.

    For instance, a new_from_config method as you suggest would be fantastic for a class full of attributes that all had to (or at least could…

  • Buddy Burden commented on Moose-iplicity

    Thanx for the comment Wayan. I'm always glad to see folks jumping into the discussion.

    > Your "neat trick" leads to a very untidy design. You just created a single class which implements two very different, completely unrelated things:
    >
    > * some unspecified action for which foo and bar are needed, which is the sole purpose of Thing instances
    > * initialization of your instances from the configuration

    Well a couple of things here:

    • This is just an example. Reading from a config file is a pretty basic thing to write example code for, and it's…

  • Buddy Burden commented on Moose-iplicity

    > Thus there is no space (in this particular example) for Moose cleverness
    > like Moose::Meta::Attribute::Native::Trait::Hash, lazy, handles, ...

    Well, sure: if you don't need lazy attributes to solve your problem, then you don't need this pattern. But, also, if you don't need objects, you don't need this pattern. ;-> (And we could continue in that vein forever, basically—if you don't need software, if you don't need a computer, if you don't need technology ...)

Subscribe to feed Responses to Comments from Wayan

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.