Lecture #9 - Hierarchy Examples

Web Resources:

CppReference.com, CPlusPlus.com, C++ TechLinks
Going 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 presents code examples of hierarchical relationships in the C++ language. We emphasize understanding the semantics and processing model for these relationships.
  1. Syllabus
    Describes topics to be covered, reading material for you to digest before coming to class, and due dates for the assigned projects.
  2. Readings for this Lecture:

    Class Text, CPPP:
    • review Chapter 7 - Classes
    • read carefully Chapter 15 - Object Oriented Programming
  3. new style casts demo, const pointers demo
  4. Projects:

    Project #1, Project1HelpS17
    NoSql Database

    Project #2, Project2HelpS17
    Dependency Analysis

    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.
  5. More on Projects:

    DemoCurrentDirectory
    Help with console processing that illustrates code language ideas and some C++11 constructs.

    Project #2, Project2HelpS17
    Parsing source code and building Dependency Relationships.

    Helper codes to look at:
    The Project2HelpS17 folder has a FileMgr Demo and a Tree Walk Demo both of which will be useful for Project #2.

    Project #3
    Code Publisher
  6. Class Hierarchy

    Hierarchy Presentation
    Hierarchy is concerned with the relationships between classes - aggregation, composition, inheritance, and using.

    Three Tier Hierarchy - a common idiom

    Demonstrate Composition
    This project contains a number of demonstrations of basic composition relationships.

    Demonstrate Inheritance
    Contains demonstration of things to be careful with when using inheritance.

  7. Polymorphism reloaded

    Virtual Function Pointer Table structure
    The mechanism that makes polymorphism work!

    XmlDocument - classic use of polymorphism

    Vectors of Polymorphic Objects - Example Project
    Shows how to use heterogeneous objects in an STL container.

    Liskov Substitution Principle
    The First Law of OOD.

  8. Design Rules
    Design rules and idioms that transcend Object Oriented Design.
  9. These are the most important items from today's lecture:

    Three Tier Hierarchy - a common idiom

    Demonstrate Composition
    This project contains a number of demonstrations of basic composition relationships.

    Demonstrate Inheritance
    Contains demonstration of things to be careful with when using inheritance.

    Virtual Function Pointer Table structure
    The mechanism that makes polymorphism work!

CST strip