As I see it, it is. To use ORM, you usually have to add a few php functions and then connect to the database and essentially execute a MySQL query or something like that.
Why all the abstractions between code and database? Why can't we use what we already know? As a rule, a web developer knows his backend language, his db language (some SQL) and some external interfaces, such as html, css, js, etc.
In essence, we are trying to add an abstraction layer that includes many functions (and we all know that php functions can be slower than assigning a variable). Yes, it is microcomputation, but nevertheless it develops.
Now we have not only several functions, but we also need to find out how ORM works, so it is wasted there for some time. I thought the whole idea of code separation was to keep your code separate at all levels. If you are in the world of LAMP, just create your query (you must know MySQL) and use the existing php functionality for prepared statements. DONE!
LAMP WAY:
- create a query (string);
- use mysqli prepared statements and retrieve data into an array.
ORM WAY:
- run a function that receives an object
- which executes a MySQL query
- run another function that adds conditional
- run another function that adds another conditional
- run another function that combines
- run another function that adds conventions to join
- run another function that prepares
- runs another mysql query
- run another function that retrieves data
- runs another mysql query
Does anyone have problems with the ORM stack? Why are we becoming such lazy developers? Or so creative that we harm our code? If it does not break, do not correct it. In turn, correct your development team to understand the basics of a web developer.
Webmaster g
source share