Sistema Ereditarietà standard per node.js e browser (tra cui IE6)?
-
09-10-2019 - |
Domanda
Sto cercando un patrimonio sistema standard che può funzionare in entrambi i node.js e browser.
sys.inherits non funziona in vecchi browser (Object.create).
Tutte le js librerie (jQuery, extjs, Dojo ...) hanno simili ma diff sistemi Eredita. (Non so che uno è buono per node.js)
Vuoi usare uno che è semplice e può diventare il "standard" in futuro (almeno in node.js sistema basato).
Qualche idea? Quale stai usando?
Anche scoperto alcuni progetti interessanti:
http://howtonode.org/prototypical-inheritance (Non va bene per IE)
http://jsclass.jcoglan.com/modules.html (Troppo grande, troppo ruby?)
A proposito, sto usando require.js in frontend.
Grazie
Soluzione
Usa Node.JS lato server sys.inherits, uso qualunque sia il vostro usi quadro nel front-end.
Keep it simple.