A critical design decision in the object-oriented world is whether to choose cohesion or coupling. These two approaches are not mutually exclusive. However, it is rare to see a mix of the two. Therefore, this decision in the architecture will profoundly impact the rest of the project.
Big or Small, Cohesion or CouplingIt helps to set the stage for this discussion. The decision comes down to either building your system with small components or large (more full-featured) ones. The result can range from microservices up to a monolithic class that stands alone. A single object option is a cohesive approach, while coupling uses smaller classes that work together.
Pros and ConsEach of these approaches has pros and cons. Thus, we need to evaluate which option is better for our specific situation. While most solutions can be implemented using either method, some will only be useful if done with one of the options. In general, considerations like performance, quality, and maintainability will be impacted by this choice.
Fast or Flexible, Not BothThere are several nuances involved in each of these options. Nevertheless, the decision will often boil down to building a system that is fast or that is flexible. This situation is not an uncommon trade-off that needs to be decided on during the architecture (and design) phase. A cohesive solution will often perform faster and tighter. On the other hand, a coupling approach is more flexible at the cost of overhead and speed.
Either of these two options can be implemented poorly. Thus, selecting one or the other does not guarantee a specific outcome. However, it is easier to stay simple and fast using cohesion. Likewise, the coupling approach tends to be easy to adjust and extend.