I am reviewing a lot of my code, and I keep returning to the question: "What structure should I base on all my JS classes?"
Some sample templates:
http://www.klauskomenda.com/code/javascript-programming-patterns/
As a result, I had a mixed approach, with the basic pub / sub functions. I do not use a prototype or module template, I define public / private properties / methods inside the constructor.
For instance:
function ClassName(){
var _privateVar = 'private';
this.publicVar = 'public';
function _privateMethod(){};
this.publicMethod = function(){};
}
What patterns do you often use in JS? For what? Regular sites? Full web application? What made you choose one pattern over another?
Or do you think this is less important than I think?
Thanks in advance.
EDIT: , , . - ? ?