D
David Abdala
Guest
I've re-read your post, and somehow it sounds like the "factory pattern": An object which is responsible for instantiating the "right" object to be use. That means that my previous answer still stands, but instead of instantiating the object directly, you would: myFactory = new BongFactory(). myBong = myFactory('Sharp'). ... myBong = myFactory('VerySharp'). .. myBong = myFactory('Bong'). I would not recommend this usually, because is a lot of overhead for not a real gain.. but as always, this is a "general rule" not a "fixed rule", it always depends on what exactly are you doing (I've use this approach several times, after making sure that the problem I'm solving with it is more complex than the implementation and use of the factories).
Continue reading...
Continue reading...