基于原型编程首先要考虑的问题:原型与对象的关系;

使用原型概念建立基于复用目的的联系链,以供运行时系统使用。

一、原型系统原理

封装、原型、多态 vs 封装、继承、多态

引用原型 vs 复制原型 机制

原型系统的复制操作,有两种实现思路,一个是并不真的去复制一个原型对象,而是使得新对象持有一个原型的引用,另一个是切实地复制对象,从此两个对象再无关联。历史上的基于原型语言因此产生了两个流派,显然,JavaScript 显然选择了前一种方式。

https://www.zhihu.com/question/54870785;

二、原型及原型链构建

三、运行时

Delegation[edit]

In prototype-based languages that use delegation, the language runtime is capable of dispatching the correct method or finding the right piece of data simply by following a series of delegation pointers (from object to its prototype) until a match is found. All that is required to establish this behavior-sharing between objects is the delegation pointer. Unlike the relationship between class and instance in class-based object-oriented languages, the relationship between the prototype and its offshoots does not require that the child object have a memory or structural similarity to the prototype beyond this link.

https://www.cnblogs.com/feng9exe/p/8289967.html

四、动态语言

http://www.cnblogs.com/Proteas/archive/2013/03/11/2953915.html

class based本身是对类型系统更友好的,而prototype based本身是需要动态类型或者弱类型的,因为“原型链”意味着一个对象的类型随时会改变,甚至一个对象的类型只能是这个对象本身。

最新文章

  1. HTTP状态码(HTTP Status Code)
  2. 简单爬虫,突破IP访问限制和复杂验证码,小总结
  3. iOS 使点击事件穿透透明的UIView
  4. linux常用指令
  5. JAVA动态加载JAR包执行程序
  6. 使用 SELinux 和 Smack 增强轻量级容器
  7. jQuery图片延迟加载插件jQuery.lazyload
  8. 网页热力图 heatmap js
  9. C++对象的JSON序列化与反序列化探索完结-列表的序列化与反序列化
  10. Python学习笔记之基本语法学习1
  11. bgp选路原则【第二部】
  12. 关于Ueditor存储在mysql"UTF-8"乱码的问题
  13. python爬虫之静态网页——全国空气质量指数(AQI)爬取
  14. css书写规范以及如何写出赏心悦目的代码
  15. MySQL索引优化步骤总结
  16. Anaconda安装新模块
  17. Map 数据结构
  18. MySQL调优基础, 与hikari数据库连接池配合
  19. 设计模式 -创建型模式 ,python工厂模式 抽象工厂模式(1)
  20. iOS 7.1 系统可以设置 button shapes,此功能可让按钮多一条下滑线

热门文章

  1. [原创]Ladon5.7大型内网渗透综合漏洞扫描器
  2. 【Appium + Python3】之安卓8.1,使用xpath定位不到元素
  3. pychram 激活码
  4. golang基础语法
  5. 『正睿OI 2019SC Day1』
  6. 理解 BLS 签名算法
  7. Linux环境:VMware下windows虚拟机与linux主机进行文件共享的方法
  8. 【开发笔记】-Ubuntu环境命令初始化
  9. 时间格式在ios和安卓兼容性的问题:
  10. JavaScript 之 Math对象