Skip to content

Instantly share code, notes, and snippets.

@jumpcheng
Forked from stujo/orm.md
Last active August 29, 2015 14:21
Show Gist options
  • Save jumpcheng/0f4ddd4fe0ab385bc1aa to your computer and use it in GitHub Desktop.
Save jumpcheng/0f4ddd4fe0ab385bc1aa to your computer and use it in GitHub Desktop.

Revisions

  1. @stujo stujo revised this gist May 11, 2015. No changes.
  2. @stujo stujo revised this gist May 11, 2015. No changes.
  3. @stujo stujo revised this gist May 11, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions orm.md
    Original 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``
  4. @stujo stujo revised this gist May 11, 2015. No changes.
  5. @stujo stujo revised this gist May 11, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion orm.md
    Original 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
    * Each Model ``class`` maps to a database ``table``
    * 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
  6. @stujo stujo revised this gist May 11, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion orm.md
    Original 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
    # 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``
  7. @stujo stujo revised this gist May 11, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion orm.md
    Original 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
    # Implementation for SQL RDBMS Databases
    * Each Model ``class`` maps to a database ``table``
    * Class methods map to actions on the table
    * ``find``, -> ``SELECT``
  8. @stujo stujo revised this gist May 11, 2015. No changes.
  9. @stujo stujo revised this gist May 11, 2015. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions orm.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    #Object Relational Mapping

    # 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``

    #Optional Code Along
    # 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/)
  10. @stujo stujo revised this gist May 11, 2015. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions orm.md
    Original 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
    * Each Model ``class`` maps to a database ``table``
    * Class methods map to actions on the table
    * 'SELECT'
    * ``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

  11. @stujo stujo revised this gist May 11, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion orm.md
    Original 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
    * 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

  12. @stujo stujo created this gist May 11, 2015.
    18 changes: 18 additions & 0 deletions orm.md
    Original 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/)