On Monday 12 Jan 2004 5:26 pm, Paul Johnson wrote: > On Mon, Jan 12, 2004 at 04:21:58PM +0000, Gary Stainburn wrote: > > The only functionality gain would be the ability to have multiple > > trainsets. This will never be requred. > > I've not been fully following this thread, but this comment caught my > eye. I think that is a very dangerous assertion to make. Good code is > often used in ways its original author didn't envisage. Of course, the > worse your code, the more likely your comment is to be true. ;-) > > This is a general comment and you might feel that it doesn't apply in > this specific case. You might well be right, but I think that in > general good designs try hard not to paint themselves into a corner.
This is a very good point, and I am currently looking at changing my code to better modularise and to have a Trainset object. My two stumbling blocks are still: 1) How could a sub-class access the Trainset globals without knowing the instance of the Trainset object? 2) How do they do this quickly? One possibility I've just thought of is to store the Trainset object as a ref inside each sub-class object. This would then allow for multiple Trainset instances, but would greatly increase refcounts, memory usage, complexity and expense of access etc. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
