in reply to Class::Trait to the CPAN?

Ovid, you asked:
* Have you ever used traits in any language?

Have You? On anything other than toy examples? It sure doesn't sound like it (apologies if that is incorrect). Might it not be a good idea to try out Traits yourself on at least one real world project before releasing it where unsuspecting people might assume it was designed and written by someone with actual working knowledge.

Replies are listed 'Best First'.
Re: Re: Class::Trait to the CPAN?
by Ovid (Cardinal) on Feb 17, 2004 at 16:07 UTC

    That's actually an excellent point. ++. I read the traits paper and saw a lot of potential, so I decided to implement the idea. However, given that I've not found much real-world usage, there's not much prior art for me to go on, other than following the Smalltalk examples (and I don't know Smalltalk well). Hence this post seeking advice.

    The package is currently at version 0.02, so it's pretty clear that it's alpha code, but I should add a strong caveats section to the docs -- namely that I've not used traits before in any real project and thus am less sure of the interface or even the best usage.

    You wrote that it doesn't sound like I've used traits before. Did you get that impression because of some misunderstanding on my part? If so, I'd love to have it cleared up.

    Cheers,
    Ovid

    New address of my CGI Course.

      You wrote that it doesn't sound like I've used traits before. Did you get that impression because of some misunderstanding on my part? If so, I'd love to have it cleared up.

      I got that impression simply from the lack of any discussion of real world usage in your posts here and on use.perl. And from the kinds of questions you were asking.

      Don't get me wrong. I do not think it is a bad idea that you are writing this module, I just think that CPAN'ing it is somewhat premature given your lack of working knowledge of Traits.

      I'd suggest at least trying it out on one of your existing (real) projects to get a solid feel for how Traits can affect your design (composability wise). First, using what you know of Traits from the theoretical perspective, write yourself some 'Use Cases' for how you would like to apply Traits (that's right, programmer's should write Use Cases for themselves when designing new libraries, modules, methodologies, etc. After all, the programmer is the "user/customer" of such technologies). Then look to reworking an existing project with a non-trivial class/object hierarchy that might benefit from composing with Traits. Let your design be informed by theory, but driven by practice.