redtap wrote:
What are the benefits using...
http://www.ayende.com/projects/nhiberna ... erics.aspxover not using it? and are they massive benefits?
Because I find using it kinda confusing...
Thanks!
At first glance, I also thought that implementation was a little confusing and brought extra complexity that I was not sure was worth it. Not only would I have to adopt those methods, people coming behind me would have to understand why the code is written in an unusual way.
I would highly recommend downloading the latest NHIbernate alpha. That's what I'm using and the generics implementation is very intuitive and has worked very well for me so far. It will allow you to work with generics that way you are used to working with IList collections and NHibernate. Admittedly, I've only used it in a very simple way, but I'm using the alpha to get the generics support.
As others have pointed out, using generics helps with data binding. Since .NET is a strongly typed environment for the most part, it helps to have strongly typed collections. It makes data binding and such easier and eliminates having to cast objects here and there and can prevent errors such as stuffing the wrong type into a collection. It makes your code easier and more obvious to read when your collections reflect the type being used rather than just object. It can also help build some generic methods that have the ability to be used in a type specific way. I've found it very helpful. I think if you try it, you'll like it.