What would you choose for your ASP.NET Webapp; nHibernate, Linq or SubSonic

Is something else possible? I already use nHibernate, but I am having occasional problems when a lazy initialized proxy object is not actually initialized. I'm going to try something else. The site has user accounts, user messages and photos and their filtering for specific place names and match names and descriptions. Not to mention voting, rating and labeling as a favorite. All this leads to a different amount of load db.

+4
source share
13 answers

I like SubSonic as it is easy to set up and create DAL. The implementation is not a full-fledged ORM, since it only creates a class for each table. The ability to use stored procedures compensates for when you need to create objects that are the result of a join. Again, SubSonic is designed to function, so it will quickly help achieve project goals.

However, you cannot use SubSonic to "create objects" - there is no configuration file that describes the relationship between classes. The database still dictates how you shape your decision.

+1
source

SubSonic is currently being used with great success in all of our web applications. In minutes, your entire database can be generated from scratch, ready for use in your application. Rob Conery, the creator of SubSonic, has some great webcasts detailing how to get the settings for SubSonic bits in a web application, as well as some interesting demos to get you started. Check out the SubSonic Project .

+5
source

I have been using LLBLGen Pro for my ORM for about a year, and it works pretty well. Although I have not used SubSonic, they tell me that they are similar. From scratch, it can create a layer of access to data from your database and be ready to use in just a couple of minutes. There's a little learning curve there, well, at least for me, but the help files provide enough information so you can go through almost everything you come across. The application can be used as installed without problems, but also supports extensive customization (maybe too much?).

+4
source

I would use NHibernate. Persistence Notorance is one of the main outlets for me, and not database binding is another. The Entity Framework is deeply corrupted, more than just the lack of lazy loading. EF and LINQ2SQL are new technologies, while NHibernate is very mature and has seen much more action.

Another useful thing about NHibernate is the ability to switch databases without editing. I use this for integration tests that run locally, run them for SQLite, and then SQL Server on the CI server .

+3
source

We use the ADO.NET Entity Framework on a fairly active site (10,000 visits per day). It was solid for us. The lack of lazy loading is annoying, but it makes you think about moving to the database.

+2
source

If your database inheritance model works with Linq with very limited inheritance support, I will say that for Linq. If you need more complex inheritance scenarios, I would say that you should stick with NHibernate and work through any pain you encounter.

+2
source

Another option is Castle ActiveRecord . It implements the Active Record template on top of NHibernate, and also removes most of the configuration (for example, its "isWeb", for example) and display.

+2
source

If you are having some problems with lazy initialized proxies, why don't you go without it? Only lazy bags. I think it's worth a try before rewriting the application with the framework without lazy loading.

+1
source

My experience in the Microsoft ecosystem:

I used Linq2Sql for several projects, and I ran into the "Layering" problem that azamsharp mentions.

Not that it helps much if you are dead when sending POCO back to your logic or user interface level, but implementing a repository template helps a little with this nasty stratification and separation of problems.

Good basic Impl repository

For anything that uses complex semantics, such as voting or statistics (basically any domain object that needs to be displayed or managed differently than it is presented in the database), the ADO.Net Entity Framework gives you some advantages. It can simplify your business logic / data access level by incorporating sophisticated data retrieval.

Entity Framework ADO.Net Overview

Hope this helps!

+1
source

I don't like SubSonic. To me, this seems like a very subtle DAL tool. With SubSonic, I still print a lot of string literals that seem a bit of a defeat to me. Personally, I prefer LLBLGen:

http://www.llblgen.com/defaultgeneric.aspx

Frans Booms, the creator, has a very good blog that discusses many of the issues related to DAL and ORM technologies.

http://weblogs.asp.net/FBouma/

+1
source

LINQ is a great choice. It is used here in Stackoverflow, and in my current project we use LINQ for our data access.

0
source

Hibernate for Java projects, but no doubt LINQ for .Net. Why add an external dependency when building LINQ?

0
source

I would also go with LINQ, although I must admit that LINQ to SQL has problems with partitioning. I read a lot of articles about LINQ to SQL, and all of them assume that it is mainly created for RAD applications.

0
source

Source: https://habr.com/ru/post/1277624/


All Articles