in reply to Re: Re: Constructor/Factory Orthodoxy
in thread Constructor/Factory Orthodoxy

I had a think about your example and I think that its reasonable to do something like that. I think I'd probably do the same.

However, I have been trying to think about how to get around your problem without doing this (purely for academic purposes) and the only thing I could think of was a variation on the Decorator pattern? Even then I'm not sure ;)

Its nice that Perl has this flexibility, I am curious as to how this would be done in a statically typed language such as Java or if you wanted to practise a 'purer' OO approach.

Again, purely for academic reasons.

SP