课程说明
C++很博大,面向对象(Object Oriented)很精深;为了以良好的面向对象观念和手法来设计和编写程序,每一位C++程序员或许都需要自问:我对「面向对象」了解多少?我是不是正确运用了面向对象的观念?我写的程序有未来性吗?
课程特色
深入浅出, 实例经典
课程对象
C++各层级的程序员
课程大纲
1. Single class的所谓BIG5 : copy constructor, copy assignment operator, move constructor, move assignment operator, destructor.
2. 从低阶角度看Class Hierarchies (阶层体系):
Construction(构造) 和Destruction(析构) 深究
’this’ pointer深究
’Virtual Functions’ 深究
’Polymorphism’ 深究
’Object Model’ 深究 (包含memory model, virtual mechanism, dynamic binding)
Abstraction深究; Liskov Substitution principle(里氏替换原则)
3. 从高阶角度看Classes间的各种关系
Composition (复合)
Inheritance (继承)
Aggregation (聚合)
Delegation (委托)
UML Classes Diagrams浅释
设计模式 : Template Method, Strategy, Observer, Composite, Prototype (讲解数量取决于现场情况)
专家经验 (取自《Effective C++》; 讲解数量取决于现场情况)
Item 13: Use objects to manage resources (RAII)
Item 32: Make sure public inheritance models “is-a”
Item 34: Differentiate between inheritance of interface and inheritance of implementation
Item 36: Never redefine an inherited non-virtual function
Item 38: Model “has-a” or “is-implemented-in-terms-of” through composition
Item 39: Use private inheritance judiciously
Item 18: Make interfaces easy to use correctly and hard to use incorrectly
Item 9: Never call virtual functions during construction or destruction
Item 25: Consider support for a non-throwing swap
Item 31: Minimize compilation dependencies between files