Web Resources:
CppReference.com, CPlusPlus.com, C++ TechLinksGoing Native 2013 - many experts
Herb Sutter's Blog, Herb Sutter on C++11, Herb Sutter keynote - Going Native 2012
Scott Meyer's Blog, S.M. on thread suspension, S.M.: C++11 Sampler
Stroustrup's Home Page, Code Project, Boost Library
Content:
This lecture covers Interfaces, Object Factories, and the Dependency Inversion Principle.-
Syllabus
Describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects. -
Project #2 Help:
Project #2, Project2HelpS17
Finding file dependencies from Abstract Syntax Tree Project #3
Code Publisher Policy for due date extensions - only for certified illness and work or interview trips out of town: one week extension, with proof.
Only one extension per project. -
Principles
Liskov Substitution Principle
This is a fundamental OOD principle, with some surprising subtleties when using C++. Open/Closed Principle
Another fundamental OOD principle that argues for using inheritance "hooks" and template-based classes. The Dependency Inversion Principle
Components should depend on abstractions, not other components.Classic Factory structure, Classic Factory creating polymorphic objectsInterface Segregation Principle
Illustrates how to create instances of a polymorphic type with clients knowing only the base class and factory interfaces. Object Factory Structure, Object Factory Project
This project implements a factory that allows clients to use derived classes but only bind to their abstractions. It also demonstrates the use of products with multiple interfaces. Extensible Object Factory Structure, Programming to Interface Project
This project implements a template-based "pluggable object factory" and shows how to access members of a hierarchy through an interface. Programming to Interfaces Presentation
Discusses interfaces, layers, factories, and breaking design, compile, and static link dependencies. Protocol-DLLDemo Project
Demonstrates how Dynamic Link Libraries are loaded implicitly and explicitly.
To build successfully you need to build the libraries first, then the clients.
Another fundamental OOD principle that argues for partitioning interfaces. -
Reuse and the Product Model
-
Run-Time Type Indentification Presentation
RTTI is, perhaps, the antithesis of the Open/Closed Principle. Paradoxically, I used it building the trace class. - Exceptions
- Exception demo
- Enforcements
- Software Design
-
Design Presentation
Summarizes design issues for modules and classes. -
Design Guidelines
Design rules and idioms that transcend Object Oriented Design. -
Design Summary
Design rules and idioms that transcend Object Oriented Design. -
These are the most important items from today's lecture:
Liskov Substitution Principle
This is a fundamental OOD principle, with some surprising subtleties when using C++. Open/Closed Principle
Another fundamental OOD principle that argues for using inheritance "hooks" and template-based classes. The Dependency Inversion Principle
Components should depend on abstractions, not other components. Interface Segregation Principle
Another fundamental OOD principle that argues for partitioning interfaces. Classic Factory structure, Classic Factory creating polymorphic objects
Illustrates how to create instances of a polymorphic type with clients knowing only the base class and factory interfaces. Object Factory Structure, Object Factory Project
This project implements a factory that allows clients to use derived classes but only bind to their abstractions. It also demonstrates the use of products with multiple interfaces.