It really depends on the situation.
I went from a company that used a modified ORM for a company that did not use ORM and kept writing SQL queries all the time. When I asked for the use of ORM to simplify the code, I got this blank face-to-face look, followed by all its negatives:
- Its high color
- you do not have precise control over your requests and perform unnecessary
- there is a heavy object to display the table
- its not a dry code because you have to repeat your
on on
Well, after working there for several weeks, I noticed that:
- We had several requests that were almost the same, and many times, if there was an error, only a small part would be fixed.
- instead of caching common table queries, we would end up reading the table several times.
- We repeated ourselves on the spot
- We had several skill levels, so some queries were not written most efficiently.
After I pointed this out, they wrote "DBO" because they did not want to call it ORM. They decided to write one from scratch, rather than tweaking it.
In addition, many arguments stem from ignorance regarding the ORM that I feel. Each ORM I've seen allows you to create custom queries, and even after the ORM conventions, you can write very complex and detailed queries and, as a rule, are more readable for people. In addition, they are usually very dry, you give them your own scheme, and they calculate the rest, up to matching relations.
Modern ORM has many tools that will help you, for example, migration scripts, several types of databases that access the same objects so that you can take advantage of both NOSQL and SQL DB. But you must choose the right ORM for your project if you intend to use it.
Jdahern
source share