I am developing a jQuery plugin which has multiple views. Since the code has grown much I would like to know the way to modularize the plugin.
I have used jQuery Basic Plugin Boilerplate as a design template.
I want to separate the code of each view in a different file, so that user will have to include script for only required view. And keep the code for common variables, settings and functionality in core file which will be accessible from view file. Changes made to common variables in core file and view file should be accessible reflected in both files.
After reading about design patterns, I am feeling that AMD pattern will be useful.
But I still need guidance for this.
Aucun commentaire:
Enregistrer un commentaire