C C T B H P N

Lecture #3 - Encapsulation

Data hiding

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 the notion of Encapsulation and basic Object Oriented Design relationships.
  1. The 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 Lecture #3

    Text: skim chapters 2-6, read chapter 7
    Project #1
    C++ Classes, Templates
  3. Glossary of Terms

    • Encapsulation:
      Restricting all access to a class's state to member functions of the class.
      This ensures that the class state is always valid, since only the class's methods initialize and change it.
  4. Project #1

    Dissecting the Project #1 statement - What is hard? What is easy? Suggestions. Project code - Goals, Tasks, Structure, design trade-offs, C++ specific details. Recommended strategy:
    Define packages for at least the following:
    • Executive - manages demonstration of your work on Project #1
    • Converter
    • Display
    You will probably want to add packages for helper code from Project1HelpS2019, e.g.:
    • DirectoryExplorer
    • Process (to help show you meet requirements)
    Note: you are required to demonstrate explicitly and conclusively that you meet all the requirements your code implements. The biggest part of that is to show each of the files converted from the specified path. You will find the Process project will provide a lot of help for that.
    Resources for Project #1:
  5. Encapsulation:

  6. Class Relationships:

    Class Relationships, Object Layout Diagram Compound Objects Code Snap
    Read this code and understand thoroughly - visit Stroustrup (class text) as needed class relationships - more details, class layout
  7. Equivalent Syntaxes
  8. first look at STL notes, pptx
    The Standard Template Library (STL) provides a set of useful containers, iterators, and algorithms. You can use the containers without knowing too much about how templates work. We will get to that soon.
  9. Software Design
  10. Value Types Presentation, pptx
  11. These are the most important items from today's lecture:

    Discussion of Project #1 Encapsulation Principle, Encapsulation Presentation, pptx Class Relationships, Class Layout Diagram, Compound Objects Code Snap
CST strip