tags:

views:

29

answers:

1

As I read here http://www.theserverside.net/tt/articles/showarticle.tss?id=NHibernate

for example

public class Department
{
 private int id;
 private string name;
 private IDictionary classes;
 private IDictionary professors;
}

Why not use Generic List ?

+1  A: 

Dictionaries are more efficient when performing that kind of lookup. Lists are great but if you're dealing with pairs of values (such as class ID/name, professor ID/person ID) dictionary lookups will be faster. Dictionaries also offer additional functionality, e.g. finding out if an element exists. With a list you'd have to loop through the entire thing (slower and more code) while dictionaries are indexed for you.

Hope that helps

Al
Hi thanks for this tut.
programmernovice