Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Why I want to use a Collection class

by dragonchild (Archbishop)
on Jul 10, 2002 at 13:54 UTC ( [id://180756]=note: print w/replies, xml ) Need Help??


in reply to What do you like in a Collection class?

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://180756]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-20 03:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found