Iэm making a big OLTP application from scratch,i was wondering what is the best way to access data,is it ADO.NET or Entity Framework or LINQ or .netTiers or something else. My database is SQL Server 2008 R2.
Thank you!
开发者_如何转开发What about NetTiers,how god is it?
These days, you should use one kind of ORM or another for you data access.
If you want a Microsoft product, you should be using Entity Framework over Linq2SQL (as the latter is not being actively developed anymore and is in maintenance mode).
Many people like nHibernate, an open source ORM that predates Linq2SQL and just about any other ORM for the .NET framework.
Do NOT use ORM just because it's a hot buzzword. When developing OLTP application, performance is critical and you really don't want to deal with garbage generated by O/R mappers. Hand tune your database AND your data layer. Of course, you need deep knowledge (or people with such knowledge) from both camps - RDBMS and .NET.
It's fairly good. I'd recommend trying both of them out and seeing which one you like the best. .netTiers uses the Enterprise Library Stack where EF doesn't.
Thanks -Blake Niemyjski
I would suggest setting up a repository, using LINQ2SQL and utilizing a UnitOfWork pattern for your data access. Linq2SQl is easy to learn and works great. It makes for really clean understandable and maintainable code. I would say it performs really well especially when used in combination with a repository and UnitOfWork design pattern. You can find more information on setting up your project using these best practices at Stu's Blog
The UnitOfWork pattern ensures that your memory is managed efficiently and that your DataContext never grows out of hand.
精彩评论