Are our databases are ready to listen to objects?
How the languages communicate to the database (nothing but content)?
Well this is where the Active Record pitches in: Active record is an approach that is used to access the data.
How it does?
Programming Language Database
class =====> table
object =====> single row in table
properties/methods =====> columns in table
"A database table or view is wrapped into a class, thus an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database; when an object is updated, the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view."
Now that is with Active record. Rails do implement the same pattern and with power of ruby, it does add some extra features/conventions to make developers life simpler.
Well in following posts we will see,
- How active record is implemented in rails
- What are the conventions?
- How to configure database to rails applications?
- Do we need to write xml files to configure each table?