When I was in a similar situation, I decided to write my own simple method-maker. It's worked out well for me.

(Edit: Just to clarify my reasoning)

I also used Class::MethodMaker originally. The kinds of methods I wanted to create were not in the default set, so I ended up writing my own, which is something that Class::MethodMaker is designed to allow. But since the methods I wanted to create were very similar to some of the default Class::MethodMaker types, I thought I should sort of "subclass" those methods types by reusing some of their code--another thing that Class::MethodMaker allows.

But the end result was pretty ugly. It was hard to look at my custom method types and understand what they actually did without thoroughly knowing the Class::MethodMaker internals. The methods were filled with tons of "macros" (special tokens understood by Class::MethodMaker) imported from the default method types. It worked, but it was kind of a mess.

Then I thought a better approach would be to write my own method types from scratch instead of trying to reuse code bits from the default types. At that point, I began to consider exactly what I was gaining by using Class::MethodMaker. When Class::MethodMaker 2.x development started (I was using 1.x) and backwards compatibility was only promised to "mostly" work, I decided to just write my own, simple method maker that did exactly what I wanted. So that's what I did, and I uploaded it to CPAN (plus a simple object base class that I also use). Like I said, it's worked out well for me. If anyone else wants to use my method maker, that's great. If not, I'm still happy with it.


In reply to Re: A Class:: module I don't want to write by siracusa
in thread A Class:: module I don't want to write by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.