You might already notice that I wrote a lot about design patterns and examples of use for them in Unity. I am genuinely interested in writing clean code and designing project architecture. This brings me huge enjoyment and satisfaction, especially when the team is following project guidelines and everything looks so perfect. ?
Being a programmer means that you need to improve your skills constantly. So today let’s summarize things that I wrote on this blog so far in term of Design Patterns! ?
What is Design Pattern?
The first thing that you need to understand is what “design pattern” means. So design pattern stands for a programming concept which solves conceptual problems. It can be related to creating new objects, making the code more independent or modular, or even split your project into different layers of responsibility.
There are a lot of different implementations of MVC design pattern available for Unity, but I’ve noticed one problem with most of them. They require a lot of knowledge about programming in general, and some of them use some fancy techniques which unnecessarily complicates your code.
And who wants to have hard to read and maintain code? ?
MVC stands for Model – View – Controller and is one of most used design pattern in IT, but not necessarily in Game Dev. This design pattern is used to separate your code based on use.
Here we have three parts of this pattern: Model – these are classes responsible for storing and handling data. View – these are responsible for handling displaying data and receiving input from the user. Controller – and these are responsible for the logic behind the app in general. They also handle respond to the input from view, and they are passing data into views.