- ORM or Object Relational Mapping is technique often used map the data in databases to the world of objects in our programs
- Active Record is a Design Pattern which can be used to implement ORM
- Active Record is also the name of a very popular Ruby ORM Implementation
- Domain Specific Model classes are defined for specific tables
- Each Model
classmaps to atable - Class methods map to actions on the table
find, ->SELECT
- An instance of the Model class maps to single row in the table
- An instance may refer to a 'yet-to-be-inserted' row
- The
idruby property maps to thePRIMARY KEY ID - Instance methods map to actions on that single row
save->INSERTorUPDATEdestroy->DELETE
- What about Related Objects?
cd parksandrecbundleirb -r ./parksandrec.rb