At a very high level: ORMs help reduce the impedance mismatch of object-relational resistance. They allow you to store and retrieve full live objects from a relational database without having to do a lot of parsing / serialization.
What does he give me as a developer?
For starters, this helps you stay dry. Either you, or the model diagram, are authorized, and the other is automatically generated, which reduces the number of errors and the number of code labels.
This helps with marshaling. ORMs usually marshal the values ββof individual columns into appropriate types so that you do not have to parse / serialize them yourself. In addition, it allows you to retrieve a fully formed object from the database, and not just row objects that you must wrap yourself.
How will my code be different from the individual SELECT statements that I am using now?
Since your queries return objects, not just strings, you can access related objects using attribute access rather than creating a new query. You can usually write SQL directly when you need to, but for most CRUD operations, ORM will make it easier for code to interact with persistent objects.
How will this help with access to the database and security?
Generally speaking, ORMs have their own APIs for building queries (for example, access to attributes) and are therefore less vulnerable to SQL injection attacks; however, they often allow you to inject your own SQL into generated queries so that you can do weird things if you need to. With such an embedded SQL, you are responsible for disinfecting yourself, but if you avoid using such functions, ORM should take care to automatically clear user data.
How to find out about the database schema and user credentials?
Many ORMs come with tools that will test the circuit and create a set of model classes that will allow you to interact with objects in the database. [Database] User credentials are usually stored in the settings file.
Aaron Maenpaa Dec 29 '09 at 17:34 2008-12-29 17:34
source share