IMO, the prototype javascript thingie is very useful, and classic OOP is not needed.
As an example in the real world, consider the google maps v3 api . Let the new OverlayView be implemented:
MyOverlay.prototype = new google.maps.OverlayView();
// the "constructor" function // function MyOverlay (position, node, map) {// set the parameters // this.position = position; this.node = node; this.map = map; this.setMap (this.map); }
// required onAdd function //
MyOverlay.prototype.onAdd = function() {
// observe the getPanes function inherited from OverlayView //
var panes = this.getPanes();
// bla bla //
}
// required draw function //
MyOverlay.prototype.draw = function() {
// bla bla //
}
// .. other functions //
// now instantiate an object //
var instance = new MyOverlay(position, node, map);
, (, Prototype, dojo, jquery ..) .