liveBook · Manning

Complexity

As explained in Data-Oriented Programming: Reduce software complexity

The degree to which a software system is hard to understand, rather than the computational resources it consumes.

Complexity means how hard a software system is to understand, not how many computational resources it consumes. It is relative: comparing two systems can reveal which is simpler. section 1.2 section 1.3

Traditional object-oriented designs can increase complexity when they:

  • Mix code and data, causing classes to participate in many relationships. section 1.2
  • Keep objects mutable, making behavior harder to predict and requiring synchronization in multithreaded environments. section 1.3
  • Lock data into objects and behavior into classes, complicating serialization and class hierarchies. section 1.2
Table 1.1 Aspects of OOP and their impact on system complexity (view table figure)

Aspect

Impact on complexity

Code and data are mixed.

Classes tend to be involved in many relations.

Objects are mutable.

Extra thinking is needed when reading code.

Objects are mutable.

Explicit synchronization is required on multi-threaded environments.

Data is locked in objects.

Data serialization is not trivial.

Code is locked in classes.

Class hierarchies are complex.

Compare common object-oriented design choices with their effects on understanding, synchronization, serialization, and hierarchy complexity. section 1.2

How Data-Oriented Programming: Reduce software complexity covers it

How deep it goes
Distinguishes understandability from resource usage and traces complexity to mutable objects, mixed code and data, serialization, and hierarchies.
Examples
Uses mixed classes, mutable objects, locked data, locked code, serialization, synchronization, and class hierarchies as complexity examples.
What you can do after
Evaluate whether a design is easier to understand by identifying relationships, mutability, data access, and class-hierarchy costs.
How it connects
Connects complexity with object-oriented programming, data-oriented programming, functional programming, mutability, synchronization, serialization, and design patterns.

Also explained in

Compare how 13 books explain complexity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data-Oriented Programming: Reduce software complexity. The section links point to the parts of the book it draws on.