Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: OOP: How to construct multiple instances of a class at once

by space_monk (Chaplain)
on Nov 15, 2012 at 09:30 UTC ( #1003979=note: print w/ replies, xml ) Need Help??


in reply to OOP: How to construct multiple instances of a class at once

Using the new function in the way you have suggested is not really very OOP, as others have pointed out.

An "OOP approved" way, instead of butchering new() is to have a static class method that returns the list of instances with the supplied identifiers

A Monk aims to give answers to those who have none, and to learn from those who know more.


Comment on Re: OOP: How to construct multiple instances of a class at once

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2014-09-21 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls