1 Complexity of Object-Oriented Programming

 

This chapter covers

  • The tendency of OOP to increase system complexity
  • What makes OOP systems hard to understand
  • The cost of mixing of code and data together into objects
 
 
 
 

1.1 A capricious entrepreneur

In this chapter, we explore why Object-Oriented Programming (OOP) systems tend to be complex.

This complexity is not related to the syntax or the semantics of a specific OOP language. It is something that is inherent to OOP’s fundamental insight that programs should be composed from objects that consist of some state together with methods for accessing and manipulating that state.

Over the years, OOP ecosystems have alleviated this complexity increase by adding new features to the language (e.g. anonymous classes and anonymous functions) and by developing frameworks that hide some of this complexity by providing a simpler interface to developers (e.g. Spring and Jackson in Java). Internally, they rely on advanced features of the language like reflection and custom annotations.

This chapter is not meant to be read as critical of OOP. Its purpose is to raise awareness of the tendency towards increased complexity of OOP as a programming paradigm and to motivate you to discover a different programming paradigm where the system complexity tends to be reduced, namely Data Oriented programming.

1.2 OOP design: classic or classical?

 
 
 

1.2.1 The design phase

 
 
 

1.2.2 UML 101

 
 
 
 

1.2.3 Explaining each piece of the class diagram

 
 

1.2.4 The implementation phase

 
 

1.3 Sources of complexity

 
 

1.3.1 Many relationships between classes

 
 

1.3.2 Unpredictable code behavior

 

1.3.3 Not trivial data serialization

 
 
 

1.3.4 Complex class hierarchies

 
 

1.4 Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage