C C T B H P N

Lecture #8 - Hierarchy: Class Relationships

Is-a, Part-of, May-Have-a, and Uses

Web Resources:

CppCon - 2014, Going Native 2013
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
Excellent C++ Q&A, Excellent reference - CppReference.com, CPlusPlus.com, C++ TechLinks

Content:

This lecture is devoted to hierarchical relationships in the C++ language, especially inheritance and composition.
  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. new style casts demo, const pointers demo
  3. Readings for this Lecture:

    Class Text, CPPP:
    • review Chapter 7 - Classes
    • read carefully Chapter 15 - Object Oriented Programming
  4. Projects:

    Resources for Project #2: - Source code publisher for projects
    Project #2 statement, Project2HelpS2019
    OODProject2Helper adds show/hide capability to the demo output. You will find the Parser Blog helpful for Project #2. C++ Survival Guide, doc
    Visual Studio help notes, Code Analyzer
    Project Submissions

    Current Versions of Code:

    If you go to other folders in the college server you are very likely to download out-of-date code, usually correct, but won't compile with demonstration code that uses newer features.
    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. Design for flexibility - templates and inheritance

  6. DllDemo Protocol, Another Dll demo
  7. Class Hierarchy

    Inheritance class relationships, doc, class relationships - layout view, vsd
    ClassRelationships code folder
    Demonstrates code layout in memory. Compound Object creation
    You need to understand how constructor initialization is required to control the objects you create. Hierarchy Presentation, pptx
    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.
  8. const pointers
  9. Software Design Blog Entries:
  10. Software design presentations:
    • There is no receipe for good design - it's a creative process that usually strives to balance a number of competing factors.
    • Our goals are to build programs and software systems that are elegant and simple, make their intents clear, and make them fast and reliable.
    • The presentations below provide guidance to help move us toward those goals.
    Software Design Goals, ppt
    Design Goals and Attributes - used to measure designs. Design Strategies, pptx
    Discusses styles of design and binding. Design Guidelines, pptx
    Small principles and useful techniques Design Issues, pptx
    Practical issues and problems of design and implementation
  11. These are the most important items from today's lecture:

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

CST strip