| Version 3 (modified by clange, 4 years ago) |
|---|
Tools
* JSLint, a code validator
References
Harmes, Diaz: Pro JavaScript Design Patterns
Chapters from a JOBAD point of view:
- Expressive JavaScript: the basics for high-level programming in JS, a must-read
- Interfaces: something you know from object-oriented language and that will be useful for the design of a library. They describe how to do it in JS.
- Encapsulation and Information Hiding: another basic object-oriented concept
- Inheritance: same. There are several ways of doing it in JS.
- The Singleton Pattern: may be needed for certain global JOBAD objects, e.g. the document-wide event handler
- Chaining: is provided by jQuery, AFAIK, but this chapter is helpful for understanding it. Note that the book is quite generic; it doesn't mention jQuery explicitly.
- The Factory Pattern: There is an Ajax-related example of a factory for XmlHttpRequest objects, which may be useful.
- The Bridge Pattern: Not sure whether we need this
- The Composite pattern: Not sure either
- The Facade Pattern: May be useful when integrating functionality from existing libraries, e.g. JavaScript standard functionality like DOM, or jQuery, and providing convenience functions.
- The Adapter Pattern: They have sample code related to library integration
- The Decorator Pattern: Not sure about this
- The Flyweight Pattern: Not sure either
- The Proxy Pattern: Not sure either
- The Observer Pattern: Not sure either
- The Command Pattern: seems quite useful to me for implementing the commands behind menu items, buttons, and any other GUI elements in a uniform way.
- The Chain of Responsibility Pattern: Not sure about this
