in reply to Re: Moose Design Thoughts (Traits)
in thread Moose Design Thoughts (Traits)

Cheers for the input.

The object will be used by people I don't trust :) so I'm not giving them direct access to the hash, hence it also being "private" - it'll be used a lot by front-end guys working in TT, and thankfully that forces privacy of the methods.

It'll also be used by people writing scripts (before/after TT), to set the contents of the hash before saving the state of it.

This main class will have several of these types of lists, and other simpler attributes.

I'd always previously just used a list in these circumstances, then moved to a hash for quicker lookups and less loops in checking the contents, and now using the Traits with Moose.

I've added the trait handles as I've been writing a script that needs them, gradually moving more and more towards to the Moose way of doing things.

Just wanted to make sure I wasn't going off on the wrong tangent, or maybe I've mis-understood something.

Thanks again, all greatly appreciated.

Replies are listed 'Best First'.
Re^3: Moose Design Thoughts (Traits)
by moritz (Cardinal) on Dec 22, 2010 at 17:33 UTC

    Ok, now you've told us who uses your class, but not how. Image you were not the implementer of the class, but its user. In your ideal world, what would you do with objects of that class, and how would the API look like?