Why would you use a Collection class in Perl?
  1. You want a type-independent way of handling bunches of things. (In Perl, substitute "class" for "type".)
  2. You want to encapsulate your grouping functionality so that:
    1. Everyone in a large group does it the same way.
    2. You can change the functionality "under the hood" easily
  3. You don't want to use tie because
    1. it's a P.O.S. that is annoying to maintain
    2. it doesn't scale well
    3. no-one but you understands completely
    4. it's aesthetically unpleasing when compared to your class hierarchies

People are going to object to a lot of what I just said, especially the "so everyone does it the same way" point. "What about TMTOWTDI?!" some might scream. Well, TMTOWTDI is great for your personal stuff. TMTOWTDI is great when you golfing.

TMTOWTDI is NOT great when you're working in a group of 15 people and attempting to make near-impossible deadlines. Under those conditions, you pick one way, prove that it works, then have everyone else use it. If it's encapsulated, all the better.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.


In reply to Why I want to use a Collection class by dragonchild
in thread What do you like in a Collection class? by dragonchild

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.