Object-Oriented Approaches

As I have already mentioned, there are many different ways to approach object-oriented programming with JavaScript. You can create objects or pseudo-objects with any of the following:

  • Object constructors

  • Prototypes

  • The new operator

  • Literal notation

  • Associative arrays

  • JScript.NET

Each of these methods for creating objects or pseudo-objects in JavaScript is valid, yet some are more flexible than others. This does not mean that these methods are not usefulthere are definitely situations where a particular method would be better than all the other approaches. Let's take a brief look at each of these approaches and what situations they would be useful in.


Since this chapter will be focusing in-depth on object constructors and prototypes, we will not cover these two methods in this section.

Ajax for Web Application Developers
Ajax for Web Application Developers
ISBN: 0672329123
EAN: 2147483647
Year: 2007
Pages: 129
Authors: Kris Hadlock

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net