in reply to best structure for classes?
The implementation he suggests in his book does NOT work. I worked on it and have an implementation that does, quite nicely. (I have to finish cleaning up the import function, but that's a matter of when I get around to it. I'll post it when I'm done.)
One thing to note is that different implementations are best for different things. The hash method is best when you have a class that will instantiate few objects, the objects are relatively static (don't get created and destroyed often), and have a relatively large number of attributes. The parallel array method is better for a class that will have a large number of objects, will create and destroy them on a regular basis, and has a small number of attributes. I've never worked with an array-ref type object, so I don't know much about them.
In case you're wondering, no - I haven't run it through Benchmark. I'll have to do that, soon.
|
|---|