I know that in this thread there are already many posts posted on the Internet on this topic.
However, many people tend to focus on different things when they talk about it. My main goal is to create a scalable web application that is easy to maintain. The speed of development and support is much more appreciated by ME than raw performance (or I could use Java instead).
This is because I noticed that when a project grows in code size, you must have supported code. When I first wrote my application in a procedural way and without any frameworks, it became a nightmare only after 1 month. I was completely lost in the jungle of spaghetti code lines. I had no structure at all, although I was so afraid to realize it.
Then I realized that I had to have the structure and code correctly. I started using CodeIgniter. It really gave me structure and supported code. Many users say that the framework slows down, but I think they missed the picture. The code should be convenient and understandable.
Framework + OOP + MVC made my web application so structured that adding features was no longer a problem.
When I create a model, I tend to think that it represents a data object. Maybe a form or even a table / database. So I thought of ORM (doctrine). Perhaps this will be another great implementation in my web application, giving it more structure so that I can focus on the functions and not repeat myself.
However, I have never used ORM before, and I only learned its basics, why it's good to use, etc.
So now I ask all of you guys who, just like me, strive for supported code and know how important this is, is ORM (doctrine) mandatory for supported code in the same way as framework + mvc + oop?
I want more life experience tips than โraw sql fasterโ advice, because if I only care about raw performance, I had to first abandon the + mvc + oop framework and continue to live in code code.
It seems to be so good at the MVC framework, where the models are tables.
Right now I have 150 sql queries in one file that make things easier like getting record by id, getting record by name, getting record by email, getting record X, etc. I thought that ORM could shorten these lines, otherwise I am sure that in the future it will grow to 1000 sql-lines. And if I change one column, I have to change them all! what a nightmare I thought again. And perhaps this can also give me good models that fit the MVC pattern.
Is ORM the right way for structure and supported code?