Last active
August 29, 2015 14:03
-
-
Save akirayu101/ba9dcf771eef643eb37b to your computer and use it in GitHub Desktop.
lua class design
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###lua class设计 | |
* 首先要有super chain, 能够正确无误的调用super方法 | |
* 在create阶段绑定所有的attribute,在create结束后,应该禁用掉一切我外部绑定新attribute的方法,防止别人改掉内省逻辑 | |
* 所有数据成员,应该具有一个初始值设定,对数据对象的生命,应该调用self:define_attribute(key, value, defaultValue) | |
* 对于回收时刻,应该对每一个attribute,变更成初始状态的值 | |
* 应该支持面向接口集合的delegate,以便进行组合 | |
* 应该对对象内置函数和状态位之间的hook来进行状态位的绑定,不给外部改变状态的机会 | |
* 其他优化点 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment