Linq to Sql vs Nhibernate vs SubSonic vs Stored Pr

2019-05-28 00:11发布

I am looking to develop a website for a news channel.

So, Obviously its gonna receive a lot of hits daily and will be updated a lot on daily basis..

I have experience in ASP.Net and SQL Server..

These are the technologies i am considering to work with. Please help me choose the right method considering the amount of load it will take..

Technology??

1) ASP.Net Webforms

2) ASP.Net MVC 1.0

And data access??

1) Linq to SQL (Impressive but rumours say Microsoft is abandoning it)

2) Linq to Entities (Performance issues)

3) Datreader/Dataset

4) SubSonic (No idea)

5) NHibernate (No idea)

Please explain your point while leaving your comment..

Thanks

Chitresh

9条回答
劫难
2楼-- · 2019-05-28 00:25

Performance-wise, they are all capable of handling thousands of concurrent users.

The single biggest performance consideration on any high-traffic site is caching. WebForms/MVC have excellent options for output caching actual rendered HTML (most efficient), and API caching of your data objects.

I think your best bet will be to use the data access framework in which you're most comfortable developing - which design pattern/toolset you're most familiar with. After that: cache, cache, cache.

查看更多
\"骚年 ilove
3楼-- · 2019-05-28 00:26

My tools of choice right now are ASP.Net MVC 1.0 and NHibernate.

Here's my reasoning:

ASP.Net MVC

I prefer MVC over WebForms for the following reasons.

  • ASP.Net MVC clearly separates my controller logic from my views
  • In ASP.Net MVC I don't have to work through the page life cycle that we have in WebForms
  • I find it easier to write AJAX applications in ASP.Net MVC using a good Javascript library like jquery. ASP.Net MVC also makes it super easy to return results as JSON without much work
  • It is more straightforward to write tests for an ASP.Net MVC application. As a consultant I have to multi-task between several projects at once and having good tests makes it easier to move from one project to the next.

NHibernate

While there is a decent learning curve with NHibernate it makes persisting your entities much easier. I like that with NHibernate I can: - Automatically Lazy load my collections - Cascade deletes and updates from a root object down to it's child object - A robust set of query objects including Linq, Criteria API and HQL (even direct SQL if you really want to) - Several caching options

If you're going to use NHibernate I would definitely use FluentNhibernate. It makes the mappings much easier.

查看更多
爷的心禁止访问
4楼-- · 2019-05-28 00:31

You have experience with ASP.NET and I say stay with that, but if you want to learn some new it's ASP.NET MVC good way.

Data Access depends what you need and what you prefer.

LINQ2SQL and DataReader/Dataset using direct access to DB and it's fine for simple application.

LINQ2Entities, SubSonic and NHibernate are ORM frameworks and it's good for application where you need extensibility in future.

And it's good use some repository pattern to access data.

查看更多
唯我独甜
5楼-- · 2019-05-28 00:36

The choice between WebForms and MVC really comes down to whether you like the Model-View-Controller approach. Personally, I prefer WebForms but am learning MVC (within Rails) just to broaden my experience and to gain the benefits of better testing. Either will do for your case as both are capable of scaling to large systems.

With respect to data, I would encourage you to think long and hard before selecting Linq in any form. Please see these previous discussions:

Doesn't LinqToSql Miss the Point?

Is LinqToSql Powerful Enough? Aren't fluent interfaces easy to build?

I would not recommend SubSonic as the documentation is just not there. You'll be pulling your hair out trying to figure out how it works. This is sad because, in many ways, it is a better model than Linq.

In the end, I have always chosen to go with a custom DAL wrapper around ADO.NET. First, I know what I am getting. Second, you really do have to know SQL in any event so why make life more difficult by trying to learn a second data access language? The drawbacks to Linq and SubSonic are manifest and the advantages are primarily theoretical (again, see the discussions at the links for more information).

查看更多
SAY GOODBYE
6楼-- · 2019-05-28 00:38

Microsoft isn't "abandoning" Linq-to-SQL per se, just not adding major functionality to it (in lieu of adding functionality to EF instead).

My bias would be to use ASP.NET MVC with Fluent-NHibernate. I think using those tools gives a nice balance of flexibility and ease of use. However, if you have more experience with WebForms, then using it instead will reduce your ramp-up time. I would also tend to avoid using DataSets unless absolutely necessary if you plan to use straight ADO.NET.

查看更多
迷人小祖宗
7楼-- · 2019-05-28 00:41

Since you are already familiar with ASP.NET and SQL, why not look into ASP.NET MVC and SubSonic. I think the new .NET MVC promotes cleaner and more organized code and the SubSonic ORM seems to get you up and running very fast for getting your data base involved with your code. Here's a link to find out more about SubSonic http://subsonicproject.com/docs/The_5_Minute_Demo. There's my thoughts! :)

BTW, I personally use ASP.NET MVC and NHibernate.

查看更多
登录 后发表回答