The Datamapper ORM was intended for CodeIgniter 2 use. Seeing as how we are using CodeIgniter 3 in this curriculum, all of the ORM information is still relevant for general knowledge but only applicable to CodeIgniter 2 which you can download using the link.
If you will remember, we had Query Builder assignment before which uses methods from a class -- just to generate SQL and fetch resultset for us.
ORM stands for "Object Relational Mapper", which by the name itself, just maps the class object to a specific database table, and then does some operations using the generated SQL of the class methods. A lot of companies used ORM until now, and examples of tools are Hiberate (Java), Django (Python), ActiveRecord (Ruby).
So now you realize, you already built your own simple ORM with just only fundamentals in that assignment! Congrats!! Now, read the below information, especially if they are favorite to be asked by hiring managers
Benefits
The benefit of ORM can be more appreciated when you're dealing with lots of database tables. For example, you have tables: users, products, orders, shops, reviews and so on. There are tables that relate to each other and which will let you write long queries with lots of join statements. ORM can do this for us. In fact, you can do a lot of data retrieval without writing a single query!
Not just for retrieval, but also for any data manipulation such as creating, updating, and deleting rows in the database. Imagine when a new user registers, their registration information is updated, a new activity is created, etc. You could use the ORM to call a simple function insert() to do all this without writing a single...
ORM
The Datamapper ORM was intended for CodeIgniter 2 use. Seeing as how we are using CodeIgniter 3 in this curriculum, all of the ORM information is still relevant for general knowledge but only applicable to CodeIgniter 2 which you can download using the link.
If you will remember, we had Query Builder assignment before which uses methods from a class -- just to generate SQL and fetch resultset for us. ORM stands for "Object Relational Mapper", which by the name itself, just maps the class object to a specific database table, and then does some operations using the generated SQL of the class methods. A lot of companies used ORM until now, and examples of tools are Hiberate (Java), Django (Python), ActiveRecord (Ruby).
So now you realize, you already built your own simple ORM with just only fundamentals in that assignment! Congrats!! Now, read the below information, especially if they are favorite to be asked by hiring managers
Benefits
The benefit of ORM can be more appreciated when you're dealing with lots of database tables. For example, you have tables: users, products, orders, shops, reviews and so on. There are tables that relate to each other and which will let you write long queries with lots of join statements. ORM can do this for us. In fact, you can do a lot of data retrieval without writing a single query!
Not just for retrieval, but also for any data manipulation such as creating, updating, and deleting rows in the database. Imagine when a new user registers, their registration information is updated, a new activity is created, etc. You could use the ORM to call a simple function
insert()
to do all this without writing a single...