Object Oriented Programming (OOP) and Data Oriented Design (DOD) are two radically different approaches to building software. In this blog post we illustrate both methods, introduce a middle-ground solution and represent the results of performance benchmarks.
OOP models the program behaviour through a set of objects which contain (encapsulate) relevant data and interact through calling each other methods. OOP has been the main methodology for several decades, it is well understood and widely used. The approach is criticized for its multiple levels of abstractions that makes it hard to reason about the code, bloated code bases, difficulties with testing, and most importantly, poor performance due to the overhead introduced by virtual function calls and low data proximity.