Post

ORM

βœ… ORM

Object Relational Mapping

  • Map object and relational DB automatically
  • save burden to code SQL


  • Object oriented programming: use class
  • Relational DB: use table
  • thus, there is mismatch between Object model and Relational model
  • ORM maps the relation between objects, create SQL

  • πŸ‘πŸ» with OOP, focus more on business logic
  • πŸ‘πŸ» code reusability
  • πŸ‘πŸ» less dependent on DBMS
  • πŸ‘ŽπŸ» difficult to create service with only ORM
  • πŸ‘ŽπŸ» difficult when there is a lot of procedure
  • πŸ‘ŽπŸ» less functions than MyBatis

βœ… MyBatis

  • manage framework, SQL
  • πŸ‘πŸ» more functions than ORM
  • πŸ‘ŽπŸ» need SQL coding
  • πŸ‘ŽπŸ» need to manage between object and database
This post is licensed under CC BY 4.0 by the author.