ORM Technologies vs JDBC?

前端 未结 4 420
时光说笑
时光说笑 2021-01-30 11:44

My question is regarding ORM and JDBC technologies, on what criteria would you decide to go for an ORM technology as compared to JDBC and other way round ?

Thanks.

4条回答
  •  佛祖请我去吃肉
    2021-01-30 12:09

    Complexity.

    ORM If your application is domain driven and the relationships among objects is complex or you need to have this object defining what the app does.

    JDBC/SQL If your application is simple enough as to just present data directly from the database or the relationships between them is simple enough.

    The book "Patterns of enterprise application architecture" by Martin Fowler explains much better the differences between these two types:

    See: Domain Model and Transaction Script

提交回复
热议问题