1
source | link

We (or at least I) conceptualize the world in terms of relationships between things we encounter, but the focus of OOP is designing individual classes and their hierarchies.

You're starting from (IMO) a false premise. The relationships between objects are arguably more important than the objects themselves. It's the relationships that give an object oriented program structure. Inheritance, the relationship between classes, is of course important because an object's class determines what that object can do. But it's the relationships between between individual objects that determine what an object actually does within the bounds defined by the class, and therefore how the program behaves.

The object-oriented paradigm can be difficult at first not because it's difficult to think up new categories of objects, but because it's difficult to envision a graph of objects and understand what the relationships between them should be, particularly when you don't have a way to describe those relationships. This is why design patterns are so useful. Design patterns are almost entirely about the relationships between objects. Patterns give us both the building blocks that we can use to design object relationships at a higher level and a language that we can use to describe those relationships.

The same is true in creative fields that work in the physical world. Anyone could throw together a bunch of rooms and call it a building. The rooms might even be fully furnished with all the latest accoutrements, but that doesn't make the building work. The job of an architect is to optimize the relationships between those rooms with respect to the requirements of the people using those rooms and the building's environment. Getting those relationships right is what makes a building work from both functional and aesthetic perspectives.

If you're having trouble getting used to OOP, I'd encourage you to think more about how your objects fit together and how their responsibilities are arranged. If you haven't already, read about design patterns -- you'll likely realize that you've already seen the patterns you read about, but giving them names will let you see not just trees, also but stands, copses, thickets, woods, groves, woodlots, and eventually forests.

    Post Made Community Wiki by Caleb