Returns an executable Function, which becomes the base for your plugin.
Plugin Factory provides all necessary methods and properties for easy and flexible jQuery plugin creation. It takes jQuery ease-of-use to a completely new level and allows you to write exceptionally tight and effective code. Some of the features that are responsible for it, are:
Q.PluginFactory can be found at Q.PluginFactory
.
Plugins created and registered via Q.PluginFactory become proper jQuery plugins, accessible in all the standard ways.
On top of that, they come with base implementation methods and properties already predefined for your use.
Because of that, you can focus on developing your custom functionality instead of wasting time setting
things up.
This method, in my opinion, is the most underestimated feature of jQuery. It allows you to extend objects and add new methods, override existing ones, even merge whole structures. While constructing Q, I have leveraged this feature. It's what stands behind the flexibility of the library.
Thanks to flexibility of Q, my first and most important suggestion would be: break down your work into smaller plugins that can be built on top of each other and inherit each other's methods and properties.
By looking at documentation of Q.PluginFactory.Register(), you'll see that one of the parameters you can provide to the method is a reference to a Q plugin already existing in the system. That plugin will be used as a "base" for your new one. Or, if you wish, your new plugin would extend the existing one.
To start using Q.PluginFactory, simply place the Q Library somewhere in your web application's folders, and
refer to Q.PluginFactory using the <script>
HTML tag:
<script type="text/javascript" src="path_to_file/q.pluginfactory.js"></script>
The whole PluginFactory is designed to provide everything you need for effective development. There simply isn't a way one could use PluginFactory and not be effective.
PluginFactory does not provide any properties of its own. Instead, look into documentation of individual plugins.
PluginFactory does not provide any events of its own. Instead, look into documentation of individual plugins.
These are the methods that make PluginFactory the most effective way of developing plugins in the world.
Returns an executable Function, which becomes the base for your plugin.
Creates a namespace within jQuery's plugin space and provides important callback functions as well as direct-call functionality.
Q.PluginFactory.Plugin()
and extended using $.extend()
approach.
Note however, that you may Register() your plugin before adding any custom functionality. It is, therefore, perfectly correct to create a plugin in the following manner.