ORM技术与JDBC? [英] ORM Technologies vs JDBC?

查看:121
本文介绍了ORM技术与JDBC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关于ORM和JDBC技术,与JDBC和其他方法相比,您决定使用ORM技术的标准是什么?



谢谢。

解决方案

复杂性。



ORM 如果您的应用程序是域驱动的,并且对象之间的关系很复杂,或者您需要使用此对象定义应用程序的功能。 / p>

JDBC / SQL 如果您的应用程序足够简单,只能直接从数据库中提供数据,或者它们之间的关系足够简单。



Martin Fowler的书企业应用程序架构的模式更好地解释了这两种类型之间的区别:



请参阅:网域模型事务脚本


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.

解决方案

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

这篇关于ORM技术与JDBC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆