Beautiful Code {16. The Linux Kernel Driver Model: The Benefits of Working Together}
来源:互联网 发布:c语言中主函数 编辑:程序博客网 时间:2024/06/06 00:45
题目好像很玄的样子,有点《集市与教堂》的味道。
从代码上来讲,这是一个用c实现面向对象的继承特性,像是解释C++的继承如何实现的。记得有个朋友提醒过我子类对象的内存不一定是父类的内存在后面,虽然实际是这样的,但标准没有要求。
看到((type *)0)->member就感觉很亲切。通过这个宏把一个“父类”的指针转成“子类”的指针,没有类型检查,转错概不负责,作者解释了为什么没有在“父类”中加上类型标识,他觉得程序员应该清楚可不可以转,而不是让代码去判断。这个解释我接受。
另外作者重点介绍了device结构的演化过程,迭代式的。根据需求对模块拆分,直至每个模块的功能十分单一,比如负责引用计数的模块,然后,通过“继承”把这些合并成一个模块。继承的意义也就在于此,不同层次的抽象。但是,我觉得这个也像组合,虽然组合的模块之间有继承关系,纠结,其实目的都是高内聚,两种方式而已。
这个迭代的过程就是开源开发者的合作的过程了,对此我只能仰视。
- Beautiful Code {16. The Linux Kernel Driver Model: The Benefits of Working Together}
- Beautiful Code {16. The Linux Kernel Driver Model: The Benefits of Working Together}
- enjoy the beautiful linux kernel code
- 01. The Benefits of JanusGraph
- Linux Kernel driver model
- Linux kernel driver model
- The Mindmaps of Linux Kernel
- The Layered Driver Model
- Benefits of Using the .NET Framework
- The Benefits of Hiring a Janitorial Service_111
- URAL 1788On the Benefits of Umbrellas
- URAL 1788 On the Benefits of Umbrellas
- Benefits of Code Refactoring
- understanding the kernel of the linux the third vesion
- Conceptual Architecture of the Linux Kernel(ZT)
- Analyse the Booting process of Linux Kernel
- 2.the linux device model--bus device driver
- The kernel thread khubd, from 《Essential Linux Device Driver》
- 博客开篇
- Hibernate 的原理与配置
- Android应用程序模型
- 调用com
- js动态生成table【转】js动态生成table【转】
- Beautiful Code {16. The Linux Kernel Driver Model: The Benefits of Working Together}
- TCHS SRM 31 Problem 500
- 不要存侥幸
- Hibernate包作用详解
- 全选/删除集合
- 没有生成forms authentication cookie
- Hello World!之php调用COM+组件(转)
- NetworkInterface实例 打印出与本地主机关联的所有IP地址
- 我们有多少对西方文明的偏见?——关于五千年与二百年问题的通信