I would like to know if the template model or constructor / prototype template is more applicable for my work.
I mainly use unobtrusive javascript - the HTML document has a link to the .js file.
My understanding of the module template:
- calling the INIT method (which is basically an open method that I can create and return using the module template)
- In the INIT method, assign all click events, etc.
This sounds like the perfect template for my situation, since I don't need to create objects and inheritance hierarchies, etc.
My understanding of the constructor / prototype template:
- to create objects
- to use inheritance (i.e. supertype subtypes)
Is it right that a module template is perfect for providing unobtrusive javascript?
javascript unobtrusive-javascript design-patterns module-pattern
Martin Sep 24 '10 at 20:54 2010-09-24 20:54
source share