﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Future&lt;TNHibernateQuery&gt;</title><description>That is not so simple.
  
A query may involve many entities, which may have several FirstName, etc.
  
Orderring may also be first level business concern, for that matter
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment8</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment8</guid><pubDate>Sat, 26 Jan 2008 16:50:21 GMT</pubDate></item><item><title>John Chapman commented on Future&lt;TNHibernateQuery&gt;</title><description>The closest thing I've been able to think of for sorting in the UI layer would be using something like DynamicProxy2 to build a proxy object on top of the resulting type of the query.
  
  
Basically the syntax would look something like the following SortBy(SortParameter&lt;Person&gt;().FirstName, SortOrder.Ascending) or something like that.
  
  
Now combine this with a generic delayedQuery and you no longer need to provide the type type to your SortParameter method, but instead it could already be typed on the result.  
  
  
I'm not 100% sold on this implementation yet, but I think it may be moving in a good direction.
  
  
Another option is to use expression trees, but just for the sorting.  I know what a nightmare evaluating expressions are though, so I'm not sure if that is worth it.
  
  
If you make it simple enough to add sorting information to your future query, why not let the UI handle it?
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment7</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment7</guid><pubDate>Sat, 26 Jan 2008 16:29:42 GMT</pubDate></item><item><title>Ayende Rahien commented on Future&lt;TNHibernateQuery&gt;</title><description>John,
  
It is fairly easy to let the client code handle the paging, and it is an interesting idea in many respects. You are correct that UI is usually the only thing that cares about it.
  
Sorting is more complex, and I don't think you want the UI dictating that, it would mean it has a lot more information about the code than you want it to.
  
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment6</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment6</guid><pubDate>Fri, 25 Jan 2008 14:14:44 GMT</pubDate></item><item><title>John Chapman commented on Future&lt;TNHibernateQuery&gt;</title><description>This is very similar to an idea I had.  I look at this as being very similar to the delayed execution model of Linq.  I think you could combine this with the ability to specify things like maximum results to pull and how many rows to skip at a delayed point.  Typically we only care about paging at the UI level anyway, why force our method signatures do deal with it when the result of the method could be a container like you are using?
  
  
I think the batching combined with paging would be awesome.  I would love to throw in the ordering functionality as well, but I'm not yet sure how to do that and keep this separate from query behavior.
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment5</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment5</guid><pubDate>Fri, 25 Jan 2008 12:40:29 GMT</pubDate></item><item><title>Ayende Rahien commented on Future&lt;TNHibernateQuery&gt;</title><description>As we speak :-)
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment4</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment4</guid><pubDate>Thu, 24 Jan 2008 09:56:05 GMT</pubDate></item><item><title>Marco commented on Future&lt;TNHibernateQuery&gt;</title><description>Nice! Are you adding this to Rhino.Common?
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment3</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment3</guid><pubDate>Thu, 24 Jan 2008 09:49:33 GMT</pubDate></item><item><title>Jan Van Ryswyck commented on Future&lt;TNHibernateQuery&gt;</title><description>Quite neat. Its probably the definition of the word "neat". No really, I like the idea.
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment2</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment2</guid><pubDate>Thu, 24 Jan 2008 06:16:38 GMT</pubDate></item><item><title>Bill Barry commented on Future&lt;TNHibernateQuery&gt;</title><description>Neat idea.
</description><link>http://ayende.com/3114/future-tnhibernatequery#comment1</link><guid>http://ayende.com/3114/future-tnhibernatequery#comment1</guid><pubDate>Thu, 24 Jan 2008 00:50:10 GMT</pubDate></item></channel></rss>