我可以选择哪些标准的 ORM?

发布于 2024-10-10 01:16:59 字数 446 浏览 5 评论 0原文

问:这个问题是关于我如何计算或选择适合我的 Web 应用程序的方便的 ORM。 当开始一个新的 Web 应用程序时,对于我的项目或案例(Web 应用程序),我可以考虑特定 ORM 优于另一个 ORM 的标准是什么?

我的问题的另一部分:当我开始时任何 Web 应用程序我都使用三层:

  1. 数据库层(其中包含 连接,并处理 CRUD 操作)
  2. 管理者层(数据访问 层)我的每个表的一个类 db(与 上一层)它包含 CRUD 针对特定表的操作 以及其他所需的操作。
  3. 接口层..

我使用对象数据源。这被认为是一个ORM(作为一个概念)还是我对这个概念的理解是错误的。

注意:我仍然是这个领域的初学者, ,每天我都会学到更多关于网络开发的知识。 我想要对此的解释和建议。

提前致谢。

Q: This question is about how can i figure or select the convenient ORM to my web application.
when beginning a new web application,What are the criteria on which i can consider a specific ORM is better than another one for my project or case(web application)?

another part of my question : when i begin any web application i use three layers:

  1. the DB layer (which contains the
    connections , and handle the CRUD
    operations )
  2. the Managers layer(the Data Access
    Layer) a class for each table on my
    db (loosely coupled with the
    previous layer )it contains the CRUD
    operations for the specific table
    and the other required operations.
  3. the interface layer..

and i use Object Data source.Is that considered as an ORM (as a concept) or I'm wrong in understanding this concept.

note:I still a beginner in this field ,, and every day i learn more about web development.
please i want explanation and suggestions for this point.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

月下凄凉 2024-10-17 01:16:59

至于ORM,一切都与品味有关。 nhibernate 和Entity 框架是最常见的。

As for ORM, it's all about taste. nhibernate and Entity framework is the most common ones.

北城孤痞 2024-10-17 01:16:59

您不会找到具体的选择标准 - 这是品味和偏好的问题,但您可以在此处找到比较特征

You will not find the specific selection criteria - this is a matter of taste and preference, but you can find the comparative characteristics here

只是在用心讲痛 2024-10-17 01:16:59

我对中小型项目(尤其是 Web 项目)使用 Devart LinqConnect ,对大型项目使用实体框架。这些产品方便灵活,可以让您快速上手。 LinqConnect 包括允许与 Oracle、MySQL、PostgreSQL、SQLite 一起使用的提供程序。我使用第三方提供商进行实体框架定制。

I use Devart LinqConnect for small and medium projects (especially for web projects) and I use Entity Framework for large projects. These products are convenient and flexible and allow you to start quickly. LinqConnect includes providers that allow to work with Oracle, MySQL, PostgreSQL, SQLite. I use 3-rd party providers for Entity Framework customizing.

青衫负雪 2024-10-17 01:16:59

正如 @MikeAinOz 之前提到的,实体框架是一个很好的开始,您也可以在其中连接其他数据库。此示例也是关于如何对层进行编程的一个很好的起点:

http://layersample.codeplex.com/发布/查看/47627

As mentioned previously by @MikeAinOz that Entity Framework is a good start in which you can connect with other databases as well. This sample is also a good starting point about how program layers:

http://layersample.codeplex.com/releases/view/47627

心凉 2024-10-17 01:16:59

最著名的是 nhibernate 和 EF,我个人更喜欢 EF,它的速度比 nhibernate 更好(通过 linq),并且对于使用 EF 我认为 Code First 是最有用的启动方式。

要选择哪个 ORM(在 EF 和 nhibernate 之间),您可以查看 这个博客作者是Ayende Rahien,他对nhibernate很了解,在这篇文章中他说nhibernate的成熟度更好,但是linq2EF比nhibernate更好,我可以给你的简单示例是:
您有一个 2 级主详细信息,在 nhibernate 中您应该执行 hql 从详细项目中检索具有特定条件的项目,但在 EF 中您可以简单地做到这一点,另外在 EF 中我们有 实体函数,它是为了解决问题而引入的,我希望它能够将来更有用。

most famous ones are nhibernate and EF, Personally I prefer EF, it's speed is better than nhibernate (via linq), and for working with EF I think Code First is most useful startup.

For selecting which ORM (between EF and nhibernate) you can see this blog by Ayende Rahien, who know good about nhibernate, in this post he said that maturity of nhibernate is better but linq2EF is better than nhibernate, simple sample I can give you is:
you have a 2 level master detail, in nhibernate you should do hql to retrieve items with specific criteria from detailed item but in EF you can do it simply, Also in EF we have Entity Functions which are interduced to solve problems, and I hope it will be more useful in future.

半寸时光 2024-10-17 01:16:59

我正在读一本关于 hibernate 的书,作者是写 hibernate 的人,从广义上讲,任何将关系模型映射到对象模型(例如将外键转换为包含的对象)的东西都是 ORM。

作者将 ORM 放在不同的类别中,像 Nhibernate 这样的东西属于完整的 ORM 类别,它在运行时生成 SQL,

例如 LLBGen 等其他一些工具需要通过连接到数据库来创建静态 dll,然后这些工具是用过的。

当选择 ORM 时,你应该看看用户群,如果 ORM 是活跃的,例如新版本和快速错误修复,最近 Hibernate 可能是使用最广泛的一个,在 .net 中有 Fluent Nhibernate 可以配置如果没有 xml 文件,hibernate 将使用带注释的类来实现此目的。

就我个人而言,我建议您使用基于 Hibernate 的 ORM,我认为 ROR 活动记录是标准......

I am reading a book on hibernate by the guys who wrote hibernate and by a broad definition anything that maps a relational model to an object model (ex convert a foreign key to a contained object[s]) is an ORM.

The authors put the ORMs in different category, something like Nhibernate falls in the category of a complete ORM, it generates SQL at runtime for ex..

Some other tools like LLBGen need that static dlls be created by connecting to the DB and then those are used.

When choosing an ORM, you should look at the user base, if the ORM is active, ex..new versions and rapid bug fixes, of late Hibernate is probably the most widely used one, in .net there is Fluent Nhibernate that can configure without xml files, hibernated uses annotated classes for this.

Personally I would advice you to use Hibernate based ORM, in ROR active record is the standard I guess...

岛歌少女 2024-10-17 01:16:59

对于 Microsoft 世界,坚持使用 ado.net 实体框架
对于开源世界,坚持使用 nhibernate。

For the Microsoft world stick with ado.net entity framework
For the open source world stick with nhibernate.

枕花眠 2024-10-17 01:16:59

关于简单的数据库访问,似乎有很多关于访问数据库的最佳方式的意见。

我目前正在使用 NHibernate,它在 MS Sql 和 MySql 中运行得非常好。我在此处找到了一篇博客文章,展示了如何使用 Nhibernate 连接到 MYSQL。

对我来说,决定因素是查看您将要使用的数据库,然后从那里做出决定。 Scott Guthrie 宣布了使用实体框架版本 4 的 Code First 框架。虽然我知道 Entity Framework 4.0 可与 Mysql 配合使用(链接 ),我不确定代码优先。 Code First Development 教程可以在 此处

最终,我认为它们都做几乎相同的工作,尽管如果我开始研究 ORM 并想要一些简单的东西,我可能会使用“代码优先”方法,因为它看起来非常简单。但我没有这方面的经验。我只读过它。

希望这有帮助。

In regard to simple database access, there seem to be a lot of opinions on which is the best way to access a database.

I am currently using NHibernate which works really well in MS Sql and MySql. I have found a blog entry that shows how to connect to MYSQL using Nhibernate here.

The deciding factor for me would be looking at the database you are going to be using and then making the decision from there. Scott Guthrie announced the Code First Framework that uses entity framework version 4. While I know that Entity Framework 4.0 works with Mysql (link), I am not sure about Code First. The tutorial for Code First Development can be found here.

Ultimately I think they all do pretty much the same job although if I were starting out looking at ORMs and wanted something simple I might go with the Code First approach as it seems really easy. BUT I have no experience with it. I have only read up on it.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文