-
-
Save jumpcheng/0f4ddd4fe0ab385bc1aa to your computer and use it in GitHub Desktop.
Revisions
-
stujo revised this gist
May 11, 2015 . No changes.There are no files selected for viewing
-
stujo revised this gist
May 11, 2015 . No changes.There are no files selected for viewing
-
stujo revised this gist
May 11, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,6 +10,7 @@ * ``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 ``id`` ruby property maps to the ``PRIMARY KEY ID`` * Instance methods map to actions on that single row * ``save`` -> ``INSERT`` or ``UPDATE`` * ``destroy`` -> ``DELETE`` -
stujo revised this gist
May 11, 2015 . No changes.There are no files selected for viewing
-
stujo revised this gist
May 11, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,8 @@ * Active Record is also the name of a very popular [Ruby ORM Implementation](http://guides.rubyonrails.org/active_record_basics.html) # Implementation for SQL RDBMS Databases in Ruby * Domain Specific Model classes are defined for specific tables * Each Model ``class`` maps to a ``table`` * Class methods map to actions on the table * ``find``, -> ``SELECT`` * An instance of the Model class maps to single row in the table -
stujo revised this gist
May 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ * Active Record is a [Design Pattern](http://en.wikipedia.org/wiki/Active_record_pattern) which can be used to implement ORM * Active Record is also the name of a very popular [Ruby ORM Implementation](http://guides.rubyonrails.org/active_record_basics.html) # Implementation for SQL RDBMS Databases in Ruby * Each Model ``class`` maps to a database ``table`` * Class methods map to actions on the table * ``find``, -> ``SELECT`` -
stujo revised this gist
May 11, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ * Active Record is a [Design Pattern](http://en.wikipedia.org/wiki/Active_record_pattern) which can be used to implement ORM * Active Record is also the name of a very popular [Ruby ORM Implementation](http://guides.rubyonrails.org/active_record_basics.html) # Implementation for SQL RDBMS Databases * Each Model ``class`` maps to a database ``table`` * Class methods map to actions on the table * ``find``, -> ``SELECT`` -
stujo revised this gist
May 11, 2015 . No changes.There are no files selected for viewing
-
stujo revised this gist
May 11, 2015 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ # Object Relational Mapping * ORM or [Object Relational Mapping](http://en.wikipedia.org/wiki/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](http://en.wikipedia.org/wiki/Active_record_pattern) which can be used to implement ORM * Active Record is also the name of a very popular [Ruby ORM Implementation](http://guides.rubyonrails.org/active_record_basics.html) # Implementation * Each Model ``class`` maps to a database ``table`` * Class methods map to actions on the table * ``find``, -> ``SELECT`` @@ -13,14 +13,15 @@ * ``save`` -> ``INSERT`` or ``UPDATE`` * ``destroy`` -> ``DELETE`` # Discussion * What about Related Objects? # Optional Code Along * ``cd parksandrec`` * ``bundle`` * ``irb -r ./parksandrec.rb`` # Resources * [DataMapper Pattern](http://martinfowler.com/eaaCatalog/dataMapper.html) * [Repository Pattern](http://martinfowler.com/eaaCatalog/repository.html) * [ORM Patterns: The Trade-Offs of Active Record and Data Mappers](http://pressupinc.com/blog/2014/11/orm-patterns-active-record-data-mapper/) -
stujo revised this gist
May 11, 2015 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,11 +4,14 @@ * Active Record is a [Design Pattern](http://en.wikipedia.org/wiki/Active_record_pattern) which can be used to implement ORM * Active Record is also the name of a very popular [Ruby ORM Implementation](http://guides.rubyonrails.org/active_record_basics.html) * Each Model ``class`` maps to a database ``table`` * 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 * Instance methods map to actions on that single row * ``save`` -> ``INSERT`` or ``UPDATE`` * ``destroy`` -> ``DELETE`` #Optional Code Along -
stujo revised this gist
May 11, 2015 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,14 @@ #Object Relational Mapping * ORM or [Object Relational Mapping](http://en.wikipedia.org/wiki/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](http://en.wikipedia.org/wiki/Active_record_pattern) which can be used to implement ORM * Active Record is also the name of a very popular [Ruby ORM Implementation](http://guides.rubyonrails.org/active_record_basics.html) * Each Model class maps to a database table * Class methods map to actions on the table * 'SELECT' * An instance of the Model class maps to single row in the table * Instance methods map to actions on that single row #Optional Code Along -
stujo created this gist
May 11, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #Object Relational Mapping * ORM or [Object Relational Mapping](http://en.wikipedia.org/wiki/Object-relational_mapping) is * Active Record is a [Design Pattern](http://en.wikipedia.org/wiki/Active_record_pattern) which can be used to implement ORM * Active Record is also the name of a very popular [Ruby ORM Implementation](http://guides.rubyonrails.org/active_record_basics.html) #Optional Code Along * ``cd parksandrec`` * ``bundle`` * ``irb -r ./parksandrec.rb`` # Resources * [DataMapper Pattern](http://martinfowler.com/eaaCatalog/dataMapper.html) * [Repository Pattern](http://martinfowler.com/eaaCatalog/repository.html) * [ORM Patterns: The Trade-Offs of Active Record and Data Mappers](http://pressupinc.com/blog/2014/11/orm-patterns-active-record-data-mapper/)