电子商务网站的ORM有什么好的选择?

时间:2022-02-11 06:56:53

I am using C# 3.0 / .NET 3.5 and planning to build an eCommerce website.

我正在使用C#3.0 / .NET 3.5并计划建立一个电子商务网站。

I've seen NHibernate, LLBLGEN, Genome, Linq to SQL, Entity Framework, SubSonic, etc.

我见过NHibernate,LLBLGEN,Genome,Linq to SQL,Entity Framework,SubSonic等。

I don't want to code everything by hand. If there is some specific bottleneck I'll manage to optimize the database/code.

我不想手工编写所有代码。如果存在一些特定的瓶颈,我将设法优化数据库/代码。

Which ORM would be best? There is so much available those day that I don't even know where to start.

哪种ORM最好?那天有很多东西我甚至不知道从哪里开始。

Which feature(s) should I be using?

我应该使用哪些功能?

Links, Screencast and Documentation are welcome.

欢迎链接,截屏和文档。

4 个解决方案

#1


3  

I've been using nHibernate which is a very good free solution. The one downside is the lack of documentation, which causes a slightly steep rampup time. But once you get the basics down it really speeds up development.

我一直在使用nHibernate这是一个非常好的免费解决方案。一个缺点是缺乏文档,导致一个稍微陡峭的加速时间。但是一旦你掌握了基础知识,它就会加速开发。

I like Fluent nHibernate for a way to configure without the xml files. The one thing I suggest though is to abstract out your data access from your application. this way should you choose wrong you don't have to worry about re-coding the App tiers.

我喜欢Fluent nHibernate,可以在没有xml文件的情况下进行配置。我建议的一件事是从您的应用程序中抽象出您的数据访问。这种方式你应该选择错误,你不必担心重新编码应用程序层。

#2


1  

I can only really speak for LINQ-SQL and can say that it is:

我只能说LINQ-SQL,可以说它是:

  • Easy to use
  • 使用方便

  • Quick to get you up and running
  • 快速启动并运行

  • Good for simple schemas and object models
  • 适用于简单的模式和对象模型

but it starts to fall down if:

但如果出现以下情况,它会开始下降

  • You're using a disconnected (tiered) architecture because its datacontexts require the same object instances to perform tracking and concurrency (though there are ways around this).
  • 您正在使用断开连接(分层)架构,因为它的datacontexts需要相同的对象实例来执行跟踪和并发(尽管有很多方法)。

  • You have a complex object model / database
  • 您有一个复杂的对象模型/数据库

  • Plus it has some other niggles and strange behaviour
  • 此外,它有一些其他的琐事和奇怪的行为

I'm looking to try EF next myself and MS seem to be quietly dropping LINQ-SQL in favour of EF, which isn't exactly a ringing recommendation of LINQ-SQL :)

我希望自己尝试EF,MS似乎正在悄悄地放弃LINQ-SQL而转向EF,这不是LINQ-SQL的一个响亮推荐:)

#3


1  

That depends on the architecture of the data model. I can speak to the effectiveness of SubSonic, since I'm in the process of launching a web app that it backs.

这取决于数据模型的体系结构。我可以谈论SubSonic的有效性,因为我正在推出它支持的网络应用程序。

I've run into problems with JOINs and DISTINCTs while using SubSonic. Both times, all I had to do is patch the source and rebuild the DLL. Now, I'm not at all averse to something like this, but you might be.

在使用SubSonic时,我遇到了JOIN和DISTINCT的问题。两次,我所要做的就是修补源代码并重建DLL。现在,我并不反对这样的事情,但你可能会这样。

Other than those two problems, SubSonic is a joy to use. Selects are very easy and flowing. It maps fairly closely to SQL, much the same way LINQ does. Also, SubSonic comes with the scaffolding function that should be able to pre-build certain pages for you. I'm not sure how effective it is, since I like to do that stuff myself.

除了这两个问题,SubSonic使用起来很愉快。选择非常容易和流动。它与SQL非常接近地映射,就像LINQ一样。此外,SubSonic附带脚手架功能,应该能够为您预先构建某些页面。我不确定它有多有效,因为我喜欢自己做这些事情。

One more thing, selection of specific rows as opposed to * is slow, but only in debug mode. Once you compile for release, it's actually faster.

还有一件事,选择特定行而不是*是慢的,但仅限于调试模式。一旦编译发布,它实际上更快。

That's my two cents.

那是我的两分钱。

#4


0  

I started out using Linq to SQL as the whole linq integration is awesome, but if you want to do Model First rather than Schema First and you want to have a rich domain model then nHibernate\Fluent nHibernate is really the way to go. We switched to this and is far simpler, better supported than l2s. However for straight dragging your schema into the dbml code generator, linq to sql is great. I have also heard very good things about Mindscape Lightspeed but have not used it.

我开始使用Linq to SQL,因为整个linq集成很棒,但是如果你想做Model First而不是Schema First而你想拥有一个丰富的域模型,那么nHibernate \ Fluent nHibernate真的是要走的路。我们切换到这个并且比l2s更简单,更好的支持。但是,为了直接将模式拖到dbml代码生成器中,linq to sql非常棒。我也听说过Mindscape Lightspeed非常好的东西,但还没有使用它。

#1


3  

I've been using nHibernate which is a very good free solution. The one downside is the lack of documentation, which causes a slightly steep rampup time. But once you get the basics down it really speeds up development.

我一直在使用nHibernate这是一个非常好的免费解决方案。一个缺点是缺乏文档,导致一个稍微陡峭的加速时间。但是一旦你掌握了基础知识,它就会加速开发。

I like Fluent nHibernate for a way to configure without the xml files. The one thing I suggest though is to abstract out your data access from your application. this way should you choose wrong you don't have to worry about re-coding the App tiers.

我喜欢Fluent nHibernate,可以在没有xml文件的情况下进行配置。我建议的一件事是从您的应用程序中抽象出您的数据访问。这种方式你应该选择错误,你不必担心重新编码应用程序层。

#2


1  

I can only really speak for LINQ-SQL and can say that it is:

我只能说LINQ-SQL,可以说它是:

  • Easy to use
  • 使用方便

  • Quick to get you up and running
  • 快速启动并运行

  • Good for simple schemas and object models
  • 适用于简单的模式和对象模型

but it starts to fall down if:

但如果出现以下情况,它会开始下降

  • You're using a disconnected (tiered) architecture because its datacontexts require the same object instances to perform tracking and concurrency (though there are ways around this).
  • 您正在使用断开连接(分层)架构,因为它的datacontexts需要相同的对象实例来执行跟踪和并发(尽管有很多方法)。

  • You have a complex object model / database
  • 您有一个复杂的对象模型/数据库

  • Plus it has some other niggles and strange behaviour
  • 此外,它有一些其他的琐事和奇怪的行为

I'm looking to try EF next myself and MS seem to be quietly dropping LINQ-SQL in favour of EF, which isn't exactly a ringing recommendation of LINQ-SQL :)

我希望自己尝试EF,MS似乎正在悄悄地放弃LINQ-SQL而转向EF,这不是LINQ-SQL的一个响亮推荐:)

#3


1  

That depends on the architecture of the data model. I can speak to the effectiveness of SubSonic, since I'm in the process of launching a web app that it backs.

这取决于数据模型的体系结构。我可以谈论SubSonic的有效性,因为我正在推出它支持的网络应用程序。

I've run into problems with JOINs and DISTINCTs while using SubSonic. Both times, all I had to do is patch the source and rebuild the DLL. Now, I'm not at all averse to something like this, but you might be.

在使用SubSonic时,我遇到了JOIN和DISTINCT的问题。两次,我所要做的就是修补源代码并重建DLL。现在,我并不反对这样的事情,但你可能会这样。

Other than those two problems, SubSonic is a joy to use. Selects are very easy and flowing. It maps fairly closely to SQL, much the same way LINQ does. Also, SubSonic comes with the scaffolding function that should be able to pre-build certain pages for you. I'm not sure how effective it is, since I like to do that stuff myself.

除了这两个问题,SubSonic使用起来很愉快。选择非常容易和流动。它与SQL非常接近地映射,就像LINQ一样。此外,SubSonic附带脚手架功能,应该能够为您预先构建某些页面。我不确定它有多有效,因为我喜欢自己做这些事情。

One more thing, selection of specific rows as opposed to * is slow, but only in debug mode. Once you compile for release, it's actually faster.

还有一件事,选择特定行而不是*是慢的,但仅限于调试模式。一旦编译发布,它实际上更快。

That's my two cents.

那是我的两分钱。

#4


0  

I started out using Linq to SQL as the whole linq integration is awesome, but if you want to do Model First rather than Schema First and you want to have a rich domain model then nHibernate\Fluent nHibernate is really the way to go. We switched to this and is far simpler, better supported than l2s. However for straight dragging your schema into the dbml code generator, linq to sql is great. I have also heard very good things about Mindscape Lightspeed but have not used it.

我开始使用Linq to SQL,因为整个linq集成很棒,但是如果你想做Model First而不是Schema First而你想拥有一个丰富的域模型,那么nHibernate \ Fluent nHibernate真的是要走的路。我们切换到这个并且比l2s更简单,更好的支持。但是,为了直接将模式拖到dbml代码生成器中,linq to sql非常棒。我也听说过Mindscape Lightspeed非常好的东西,但还没有使用它。