No reader told me that Javascript Constructors are actually factories; shame on you! In Javascript constructors can actually return an object of a different type. They are closer to factories than to traditional Java constructors.
While researching this post I came across a very interesting article that considers constructors harmful. I agree about the troubling concept of constructor, one of most basic parts of an Object, not being object oriented. I really recommend to read the article, since it explains the problem much better than me.
Tuesday, 6 November 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment