Actually, about long post on the techniques…
Paul, could you please explain actual situation with OOP in JS? I mean, now I use…
Class…
var Foo = function()
{
Bar.call(this); // quasi extension or misc
var me = this; // for closures and private methods
// method overriding
var oldConstruct = this.construct;
this.construct = function()
{
oldConstruct();
// something new
}
var _p = 1; // private property
this.getP = function() {return _p;} // public method
var f = function()
{
// private method
}
}
or singleton…
var singleton = new function()
{
// something
}
What about interfaces, protected methods, constants and so on?.. I don’t know.