甘草轩

Never surrender to complexity
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2008年2月25日

摘要: I’ve been waiting more than 30 years to say this: “Dad, I always told you I’d come back and get my degree.” I want to thank Harvard for this timely honor. I’ll be changing my job next year… and it will be nice to finally have a college degree on my resume. I applaud the graduates today for taking a much more direct route to your degrees. For my part, I’m just happy that the Crimson has called me “Harvard’s most successful dropout.” I guess that makes me valedictorian of my own 阅读全文

posted @ 2008-02-25 11:31 甘草轩 阅读(536) 评论(0) 推荐(0) 编辑

摘要: (1)所有数据都应该隐藏在所在的类的内部。   (2)类的使用者必须依赖类的共有接口,但类不能依赖它的使用者。   (3)尽量减少类的协议中的消息。   (4)实现所有类都理解的最基本公有接口[例如,拷贝操作(深拷贝和浅拷贝)、相等性判断、正确输出内容、从ASCII描述解析等等]。   (5)不要把实现细节(例如放置共用代码的私有函数)放到类的公有接口中。如果类的两个方法有一段公共代码,那么就可以创建一个防止这些公共代码的私有函数。 阅读全文

posted @ 2008-02-25 11:01 甘草轩 阅读(153) 评论(0) 推荐(0) 编辑

摘要: (1)所有数据都应该隐藏在所在的类的内部。 (2)类的使用者必须依赖类的共有接口,但类不能依赖它的使用者。 (3)尽量减少类的协议中的消息。 (4)实现所有类都理解的最基本公有接口[例如,拷贝操作(深拷贝和浅拷贝)、相等性判断、正确输出内容、从ASCII描述解析等等]。 (5)不要把实现细节(例如放置共用代码的私有函数)放到类的公有接口中。 阅读全文

posted @ 2008-02-25 10:58 甘草轩 阅读(127) 评论(0) 推荐(0) 编辑