CSE687 - Object Oriented Design
Lecture #11 - Open/Closed Principle
Revised: 27 Feb 2008
Web Resources:
Stroustrup's Home Page,
Assoc. of C/C++ Users,
C++ at Microsoft,
Code Project,
Sells Brothers,
Guru of the Week,
C/C++ User's Journal,
devCentral,
Dr. Dobb's Journal,
Boost Library,
techNetCast
Content:
This lecture presents the Open/Closed Principle, an ideal model for software development. We discuss how the C++
language can be used to build software following the 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
Graph data type and graph algorithms.
-
XMLParsing or XMLTran
Two modules that do basic XML handling - building XML strings and pulling them apart. They do not understand
XML namespaces or schemas. Either on will work for Project #2.
-
Project #2 Help
I Recommend that you use either Graph1 or Graph2 as a prototype for your implementations.
-
Heterogeneous List Structure
Unusual use of Liskov Substitution
-
Open/Closed Principle
Another fundamental OOD principle that argues for using inheritance "hooks" and template-based classes.
-
Extensible Parsing, from Project #1
This demonstrates the Open/Closed Principle by binding rules and actions to interfaces, used by the parser.
-
The Adapter Pattern
This pattern, one of about 30 we discuss in CSE776 - Design Patterns, illustrates one way to
adhere to the Open/Closed Principle.
-
Satisfying the Open/Closed Principle
Protocols, Hooks, Policies, Inheriting Concrete Classes.
-
Run-Time Type Indentification Presentation
RTTI is, perhaps, the antithesis of the Open/Closed Principle. Paradoxically, I used it building the trace class.
-
Lecture #11 folder
Contains a page of links to
presentations and code discussed in this class. The Lecture folders will occasionally
hold physical files of interest as well. Usually, however, all the materials
of interest to the class are in the presentations
and code folders. The contents of these folders will grow
as you progress through the course.