In the last year or so, we saw the concept of generics in managed code. Microsoft introduced them in their .NET 2.0 platform and Sun brought them into Java 5. If you haven't heard of generics before, they're kind of like templates in C++ and improve code reuse by allowing you to define classes and methods without specifying a particular type. It's a step above using the Object type because the compiler can ensure a better type safety. For example ...

using System.Collections.Generic;

List<CustomerRecord> customerList = new List<CustomerRecord>();
customerList.Add( new CustomerRecord() ); 
customerList.Add( new LineItem() ); //this will cause a compile error

Dan explained this concept to a fellow team member, as they were responsible for porting the application to .NET 2.0. His colleague scoffed, insisting he already knew this and had been doing it for years in C++, and will have no trouble with it in C# ...

Dictionary<Object, Object>  = new Dictionary<Object, Object>();

When Dan questioned his colleague on why he consistently use Generics like this, his colleague scoffed again: "duh, I want it to be generic and not tied to any particular class".

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!