Query object implementation examples [closed]

2019-02-14 02:45发布

Can anyone recommend good tutorial, implementation or sample code on Query object pattern usage, in C#(Java...)?

I haven't found much with google.

4条回答
一夜七次
3楼-- · 2019-02-14 03:02

I wrote a nice query object library for NHibernate. Check it out here: https://github.com/shaynevanasperen/NHibernate.Sessions.Operations

查看更多
不美不萌又怎样
4楼-- · 2019-02-14 03:04

With LINQ being almost everywhere, are you sure you need to reimplement the Query Object?

Basically, you can treat all classes from System.Linq.Expressions to be a good implementation of a Query Object pattern.

查看更多
唯我独甜
5楼-- · 2019-02-14 03:08

I suggest Martin Fowler's Query Object Pattern (http://martinfowler.com/eaaCatalog/queryObject.html). Get his book "Patterns of Enterprise Application Architecture", you'll find sample implementation there.

查看更多
登录 后发表回答