Introduction
The previous chapter provided detailed information on the construction of objects along with information on the different keywords that C++ provides to define these objects. We learned that we must be careful when creating our own types and ensure that they are constructed and destroyed appropriately. This chapter delves further into object-oriented programming, explaining important principles for designing classes that should be kept in mind to most efficiently utilize the object-oriented programming (OOP) paradigm.
In this chapter, we will take things a step further and introduce best practices for defining our own types. Through this knowledge, we can write classes that insulate themselves against unintended use, and, using public and private functions and member variables, we can make it clear how we do intend a class to be used.
Encapsulation allows us to hide data we do not want a user to access directly, while abstraction provides the user of a class with...