In this recipe, you will learn the first two OOP concepts—object/class and encapsulation. These concepts are at the foundation of OOD.
Implementing object-oriented design (OOD)
Getting ready
The term object usually refers to an entity that couples data and procedures that can be applied to this data. Neither data nor procedures are required, but one of them is—and, typically, both are—always present. The data is called object fields (or properties), while procedures are called methods. Field values describe the object's state. Methods describe the object's behavior. Every object has a type, which is defined by its class—the template used for the object's creation. An object is also...