From: John Carter Date: 2005-12-06T11:41:26+09:00 Subject: Re: Subclassing Class. On Tue, 6 Dec 2005, gabriele renzi wrote: > John Carter ha scritto: >> Ok. This is a wild idea. >> >> I don't like the factory pattern. >> >> We don't need no stinkin Factories. We have the Class object. > > But I wonder what is the problem you're tying to solve, if you just want to > add state and behaviour to an object, maybe you could just include/extend a > module? Add state and polymorphic behaviour, not to the object, but the object's class. And that is where the wheels fall off. @@variables give classes state. ClassName.method_name functions given classes behaviour. But it is all static, no polymorphism. (Perhaps I should have called it the factory method pattern. When I tried to find a definitive answer on that I find I'm certainly not alone in stirring that particular pot of confusion...) John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand Carter's Clarification of Murphy's Law. "Things only ever go right so that they may go more spectacularly wrong later." From this principle, all of life and physics may be deduced.