This chapter focuses on the design patterns and best practices used when implementing jQuery Plugins. We will learn here how to abstract parts of an application into separate jQuery Plugins, promoting the Separation of Concerns principle and code reusability.
We will firstly analyze the simplest ways that a jQuery Plugin can be implemented, learn the various conventions of jQuery Plugin development and the basic characteristics that every plugin should satisfy in order to follow jQuery principles. We will then proceed with an introduction to the most widely used design patterns and analyze the characteristics and benefits of each of them. By the end of this chapter, we will be able to implement extensible jQuery Plugins using the development pattern that best suits each use case.
In this chapter we will:
Introduce the jQuery Plugin API and its conventions
Analyze the characteristics that make an excellent plugin
Learn how to create a plugin by...