手册DAL& BLL vs. ORM [英] Manual DAL & BLL vs. ORM

查看:146
本文介绍了手册DAL& BLL vs. ORM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪种方法更好: 1)使用第三方ORM 系统或 2) 手动写入DAL和BLL代码使用数据库?

Which approach is better: 1) to use a third-party ORM system or 2) manually write DAL and BLL code to work with the database?

1)在我们的一个项目中,我们决定使用DevExpress XPO ORM系统,我们碰到了很多轻微的问题,浪费了大量的时间。 Amd仍然不时地遇到来自这个ORM的问题和例外,我们对这个黑盒子没有充分的理解和控制。

1) In one of our projects, we decided using the DevExpress XPO ORM system, and we ran across lots of slight problems that wasted a lot of our time. Amd still from time to time we encounter problems and exceptions that come from this ORM, and we do not have full understanding and control of this "black box".

2)在另一个项目中,我们决定从头开始编写DAL和BLL。虽然这种写作无聊的代码很多次,但是这种方法被证明是更加通用和灵活的:我们完全控制了数据库中数据库的存储方式,如何从数据库中获取数据,而且所有的bug都可以

2) In another project, we decided to write the DAL and BLL from scratch. Although this implied writing boring code many, many times, but this approach proved to be more versatile and flexible: we had full control over the way data was held in the database, how it was obtained from it, etc. And all the bugs could be fixed in a direct and easy way.

哪种方式通常更好?也许问题就在于我们使用的ORM(DevExpress XPO),还有其他的ORM比较好(比如NHibernate)?

Which approach is generally better? Maybe the problem is just with the ORM that we used (DevExpress XPO), and maybe other ORMs are better (such as NHibernate)?

使用 ADO Entiry框架

我发现DotNetNuke CMS使用自己的DAL和BLL代码。其他项目怎么办?

I found that the DotNetNuke CMS uses its own DAL and BLL code. What about other projects?

我想获取您个人经验的信息:您在项目中使用哪种方法,哪个更好

I would like to get info on your personal experience: which approach do you use in your projects, which is preferable?

谢谢。

推荐答案

合适的。您可以使用像SubSonic这样的产品。这样,您可以设计数据库,生成DAL代码(删除所有无聊的东西),使用部分类来扩展自己的代码,如果需要,使用存储过程,并且通常会获得更多的东西。

Perhaps a little of both is the right fit. You could use a product like SubSonic. That way, you can design your database, generate your DAL code (removing all that boring stuff), use partial classes to extend it with your own code, use Stored Procedures if you want to, and generally get more stuff done.

这是我做的。我觉得这是自动化和控制之间的平衡。

That's what I do. I find it's the right balance between automation and control.

我还会指出,我认为你是在正确的道路上,尝试不同的方法,看看最适合您的 。我认为这最终是你答案的根源。

I'd also point out that I think you're on the right path by trying out different approaches and seeing what works best for you. I think that's ultimately the source for your answer.

这篇关于手册DAL& BLL vs. ORM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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