开发者

Should I use Linq-to-SQL or the Castle ActiveRecord implementation?

I don't want to write stored procedures any more (not unless I have to), so should I use out of开发者_如何学Go the box Linq-to-SQL or the Castle ActiveRecord implementation?

I understand there are some differences between the two as mentioned here on Stackoverflow


I would say try both, and see which suits your needs best. Asking questions like these you will most likely get another answer - "which one I like better". There's no one size fits all solution, and with little details you have given it's hard to help you really.

Notice that ActiveRecord uses NHibernate underneath, which is a much more powerful ORM than L2S, so if you intend your project to grow, it's flexibility and maturity may be helpful in the long run.


I'm not sure why you happen to be choosing between those two only?

LinqToSql currently has a better Linq provider than NHibernate.

Castle ActiveRecord is based on NHibernate. NHibernate is a lot more feature rich than LinqToSql and features are being added much more quickly to NHibernate.

Depending on the complexity of your domain, data model, and requirements, you may be forced to go with NHibernate at some point because LinqToSql just can't do what you need it to do (you haven't specified what kind of environment and requirements you have, which makes a big difference).

It can be difficult/expensive to transition from one ORM to another, so it is important to choose wisely.

There are some situations where I would recommend LinqToSql over Castle ActiveRecord, but they are few and far between. Generally, Castle ActiveRecord is much more likely to work in your situation.


Use Linq to SQL - its very easy to get started and there is a lot of documentation out there for it. In addition you don't need to take any dependencies on anything outside the box, which will save you time.


Linq-to-SQL seems to be loosing ground due to Entity Framework. Since EF integrates nicely with many new and upcoming MS technologies, you probably would not regret using EF. Not sure how it fares in comparison with Casle thuogh.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜