jquery - Javascript Inheritance Best Strategy -
currently have built our own javascript framework building widgets, divs, panels , forms our complex web application. our widgets (aka. components) inherit super object called viewable defines view htmlelememnt . viewable = { getview: function() { if (!this.view) this.view = this.createview(); return this.view; } createview: function() { alert(‘you have not implemented createview. naughty boy!); } } then use object.create(viewable) create our own components, need implement createview defined in viewable. header = object.create(viewable); header.createview = function() { var div = document.createelement('div'); div.id = 'header'; } header.foobar = function() { } i move away type of inheritance, create-object-on-the-fly , add methods on depending on mood. i have looked @ other approach using $.extends jquery. can create object (or better ‘define function’? ‘defined class’?) function header() ...