Object-oriented programming composes programs from objects that combine state with methods for accessing and manipulating that state. That arrangement can make a design look tidy while quietly making its behavior harder to understand. section 1.0
A library system that keeps growing
A library design begins with classes such as Library, Book, BookItem, BookLending, Member, Librarian, User, Catalog, and Author. The class list is manageable; the difficult part is the web of relationships between them. Adding a REST /search endpoint then introduces SearchController, SearchQuery, and SearchResult, with similar classes needed for each new JSON endpoint. section 1.1.1 section 1.2.3
Traditional OOP tends to increase complexity in several connected ways:
- Mixes code and data in classes, making classes participate in many relations. section 1.2
- Keeps data mutable, requiring extra reasoning about behavior and explicit synchronization in multithreaded environments. section 1.2
- Locks data inside objects, making serialization nontrivial. section 1.2
- Locks code inside classes, encouraging complex class hierarchies. section 1.2
Table 1.1 Aspects of OOP and their impact on system complexity (view table figure)
| Explicit synchronization is required on multi-threaded environments. |
|
Compare OOP aspects with their effects on system complexity, including mutability, serialization, and class hierarchies. section 1.2
Complexity here means difficulty of understanding, not resource consumption. OOP is not condemned outright: design patterns can mitigate complexity, and systems that separate code from data can be simpler. Data-oriented programming offers a related alternative and remains compatible with OOP. section 1.2 section 1.3








