Coldfusion 中的 ORM,现有的 cfqueries
我正在开发一个使用 Coldfusion(cfquery 标签和存储过程)构建的网站。
我正在考虑学习/将网站转移到 ORM,但我想知道这会涉及多复杂。
例如,我可以使用 ORM 来构建新页面来检索数据,然后慢慢将旧页面转换为 ORM 吗?
或者打开 ORM 是否会破坏我的网站上当前使用的查询和存储过程?
I'm working on a site built with Coldfusion (cfquery tags and stored procedures).
I'm considering learning / moving the site over to ORM, but I was wondering how involved / complicated this would be.
For example, can I build new pages going forward using ORM to retrieve my data, and then slowly convert my older pages to ORM?
Or does turning on ORM break the queries and stored procedures currently being used on my site?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以“使用 ORM 构建新页面来检索(您的)数据,然后慢慢将(您的)旧页面转换为 ORM?”
对于复杂的查询,继续使用现有的东西,ORM 不会对你有太大帮助。
无需进行完整的 OO,您可以使用 ORM 来帮助您进行 CRUD,而无需编写一行 SQL。
yes, you may "build new pages going forward using ORM to retrieve (your) data, and then slowly convert (your) older pages to ORM?"
For complex query, keep using what you had, ORM will not help you much.
Without doing full OO, you can use ORM to help you do CRUD without coding a line of SQL.
Henry 的回答很好,但我想到了一个问题:如果您有一个已经可以工作的网站,为什么要对其进行修改以将其转换为使用 Hibernate?您在这里感受到的好处是什么?我并不是说没有(〜根本没有。我并不是说没有充分的理由:这不是一个加载的问题),但我会犹豫是否要在没有良好的情况下弄乱网站的工作代码原因。
如果您确实决定进行更改,我会大量负载测试“更改之前”和“之后”。
Henry's answer is a good 'un, but one question occurs to me: if you have an already working site, why would you mess with it to convert it to using Hibernate? What's the benefit you're perceiving here? I'm not saying there isn't one (~ at all. I don't mean to suggest there is no good reason: this is not a loaded question), but I would be hesitant to mess with a site's working code without good reason.
And if you do decide to make the change, I would heavily load test the "before" and "after" change.