Member-only story
Object-Oriented Programming (OOP) vs Data-Oriented Tech Stack (DOTS) in Unity
If you have been developing using Unity for quite some time, you should have heard of DOTS by now. It is a fundamental change in Unity’s architecture and it also signals a change in how developers think about code and data. This data-oriented design (DoD), an opposite approach to the long-time default standard in many industries object-oriented design enables developers to take advantage of the multicore processors and has proven to increase performance in applications. However, one thing to note is that DOTS is not a direct opposite of OOP because DOTS in Unity encompasses multiple technologies that deliver the data-oriented approach.

Now, in Unity, DOTS consists of several components working together:
- The Entity-Component-System (ECS) framework
- C# Job system for multithreading
- Burst compiler for optimized native code
DOTS >> OOP
One huge advantage of DOTS compared to OOP is the way data is handled in Unity. Data structures are handled such that cache misses are avoided for the most part and this results in increased speed and efficiency. The separation between data and implementation…