javascript - 基于原型(prototype)继承在实际项目中的应用

标签 javascript design-patterns inheritance prototype-programming prototypal-inheritance

基于类的继承展示了它在创建大型编程系统(尤其是 GUI 系统)中的有用性。

如何在现实生活中应用基于原型(prototype)的继承?我们应该如何构建系统而不是创建类层次结构?

对于基于类的 OOP,是否存在任何基于真正原型(prototype)的 OOP 的编程模式?

最佳答案

nahab: Are here exist any programming patterns for real prototypical based OOP as exists for class-based OOP ?

question应该会指导您找到一些关于实用 Javascript 设计模式的好资源。

nahab: How can be applied Prototypical-based inheritance in real life applications? How we should build system instead of creating classes hierarchies?

参见 this list Lua 用户(另一种基于原型(prototype)的语言),注意到它在 Adobe Lightroom 中的使用。

关于javascript - 基于原型(prototype)继承在实际项目中的应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6003014/

相关文章:

C++类和继承错误: undefined reference to derived class

javascript - Django + skelJS/静态文件问题/CSS 中对图像的引用

java - 将许多 'if else' 语句转换为更清洁的方法

python如何执行调用函数的对象方法,该函数调用同一对象的另一个方法

php - PHP显式变量在闭包中的优势

基础组件的 Angular 使用模板

javascript - 无法通过 chrome 扩展的 Ajax 请求将值存储在数据库中

javascript - 如何使用 JavaScript 手动重新加载 Google map

javascript - 停止表单重新加载页面

Python 基类方法调用 : unexpected behavior