<p>Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle).</p>

<p>Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in ascending order?</p>

<p>Based on the answer to the question referenced by nickf the answer is:</p>

<pre><code>select x from MyClass x order by case when x.MyProperty is null then 1 else 0 end, x.MyProperty
</code></pre>

In the Wikipedia example, those instances can be passed into a function that doesn't have to care which class those instances belong to. The function just calls
```
execute
```
on the object passed, and know that the Right Thing will happen.
A typical example of the Strategy Pattern is how files work in Unix. Given a file descriptor, you can read from it, write to it, poll it, seek on it, send
```
ioctl
```
s to it, etc., without having to know whether you're dealing with a file, directory, pipe, socket, device, etc. (Of course some operations, like seek, don't work on pipes and sockets. But reads and writes will work just fine in these cases.)
That means you can write generic code to handle all these different types of "files", without having to write separate code to deal with files versus directories, etc. The Unix kernel takes care of delegating the calls to the right code.
Now, this is Strategy Pattern as used in kernel code, but you didn't specify that it had to be user code, just a real world example. :-)