nHibernate与LLBLGen Pro [英] nHibernate versus LLBLGen Pro

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

问题描述

我正在尝试使用ORM工具进行研究,并将其范围缩小到两名候选人.

I am trying to work out with ORM tool to move over to and have narrowed it down to two candidates.

nHibernate LLBLGen Pro

请大家给我使用这两种工具的利弊,特别是如果您在这两种工具上都有经验的话.我对其他任何工具都没有真正的兴趣,但是我需要一些提示,以便我可以决定花时间学习哪种工具....

Please can you guys give me pros and cons in using both these tools especially if you have experience in both. I am not really interested in any other tools but am wanting some heads up so I can decide which tool to spend time learning....

我已经知道一个是免费的,一个不是免费的,我也知道nHibernate可能需要学习一些知识....

I already know that one is free and one isn't, I also know that nHibernate might take some learning....

非常感谢,理查德

推荐答案

我都用过.最初,我在nHibernate上被出售,即使我知道其他选择,也拒绝尝试其他任何东西.

I have used both. At first I was sold on nHibernate and refused to try anything else even though I knew about other options.

我对LLBLGen Pro持怀疑态度,但很快也看到了好处.我还没有完全放弃nHibernate.我将继续将int保留在工具箱"中.我发现LLBLGen在某些情况下很有用,尤其是在与已经存在的数据库进行交互并且您没有选择重新设计的时候.从数据库生成我的LLBLGen实体对象需要不到一个小时的时间(当然取决于数据库的大小),而不是必须使用nHibernate手动编写所有对象并进行映射. nHibernate缺少一个漂亮的图形界面来创建映射.当数据库庞大且需要在应用程序中潜在地访问成千上万个表时,这一事实变得尤为重要.

With LLBLGen Pro, I was skeptical, but soon saw the advantages as well. I have not totaly abandoned nHibernate. I will continue to keep int in my "box of tools". I have found LLBLGen useful in some cases especially when interacting with a database that already exists and you have no choice of re-designing it. It takes less than an hour (depending on size of database of course) to generate my LLBLGen Entity Objects from the database, as opposed to having to code all of it manually with nHibernate, AND do the mappings. nHibernate is missing a nice graphical interface to create the mappings. This fact becomes even more important when the database is massive with thousands of tables that you need to potentially access in your application.

尽管LLBLGen更像是一个数据访问层生成器(而且我通常不喜欢DAL生成器),但它具有真正的ORM"工具所具有的许多功能.我认为它具有两全其美的优势.一旦开始使用它,您就会开始意识到它非常灵活且可扩展.我非常喜欢的一部分是,我可以为生成的实体对象创建部分类,在其中我可以在业务逻辑中进行编码以及进行验证.

Although LLBLGen is more of a Data Access Layer generator (And I am not normally a fan of DAL generators), it has a lot of features a "true ORM" tool would have. In my opinion it has the best of both worlds. Once you start working with it you start to realize that it is very flexible and extendable. One part I like a lot is that it is possible for me to create partial classes for the generated entity objects, where I can code in my business logic, as well as validation.

代码生成是模板化的,因此您可以完全控制它生成的代码.使用nHibernate,我发现自己会一遍又一遍地编写一些相同类型的代码.使用LLBLGen,我可以生成它,并更快地专注于业务逻辑和问题.

The code generation is templated so you have full control over the code it generates. With nHibernate I find myself writing some of the same kind of code over and over again. With LLBLGen I can generate it and get to focus on business logic and issues quicker.

对于刚开始使用ORM类型工具的人,我真的建议从LLBLGen开始,因为nHibernate可能会让人不知所措.最后,您将获得相同的结果(或多或少).

For someone who is just starting to use ORM type tools, I really recommend to start with LLBLGen, because nHibernate can be overwhelming. And in the end you will have achieved the same result (More or less).

编辑#1::LLBLGen现在还对LINQ提供了100%的支持. (因此,如果您出于这个原因喜欢LINQ to SQL),LLBLGen可以支持许多数据库,其中LINQ to SQL仅适用于Microsoft SQL数据库.

Edit #1: LLBLGen now also has 100% support for LINQ. (So if you like LINQ to SQL for that reason) further LLBLGen can support many databases, where LINQ to SQL is only for Microsoft SQL Database.

编辑#2: 根据Graviton ,您可以使用CodeSmith来为您生成一些代码对于nHibernate.这确实很酷,但是对于ORM的新手,我仍然推荐LLBLGen.对我来说,这将增加更多的依赖关系,其中LLBLGen在一个软件包中拥有了所有依赖关系.就像我之前说过的那样,学习曲线不会那么陡峭,您将获得相同的好处,如果您决定去那里,这也将帮助您轻松进入nHibernate.

Edit #2: According to Graviton you can use CodeSmith to do some of the code generating for you for nHibernate. That is really cool, but for a newcomer to ORM I would still recommend LLBLGen. To me that is adding more dependencies where LLBLGen has it all in one package. Also like I said before the learning curve is so much less steep and you will get the same benefits, which will also help you ease in to nHibernate if you ever decide to go there.

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

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