5 Guys The Evolution Of Classes In Javascript Part 2
02 January 2011
Bob can’t protect his stuff. While we could put some of bob’s stuff in private variables, we also
want Netbeans to know Bob is an instance of Guy, so we’ll change the pattern a bit to make a proper constructor.
Now, Netbeans sees Bob as a Guy.
Since Bob may have personal properties other than stuff, we attached stuff to the person object–after all,
everybody has stuff. The problem now is this person object. Netbeans does not seem to understand the
relationship of person to Guy or Bob.
On the upside, Bob learned to protect his stuff. All Guys now can keep something and will not share it,
even with please.