Chapter 5. Class Design Guidelines
One of the primary goals of object-oriented (OO) programming is to model real-world systems in ways similar to the ways in which people actually think. Designing classes is the object-oriented way to create these models. Rather than using a structured, or top-down approach, where data and behavior are separate entities, the OO approach encapsulates the data and behavior into objects that interact with each other. Don't think of a problem as a sequence of events or routines operating on separate data files. Think of how your objects model real-world objects and how they interact with other real-world objects.
These interactions occur in a way similar to the interactions between real-world objects, such as people. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access