---------------
http://www.developer.com/net/net/article.php/3403481/Using-Lists-and-Collections-in-NET.htm
http://articles.techrepublic.com.com/5100-10878_11-1045372.html
http://www.codeguru.com/csharp/.net/net_asp/tutorials/article.php/c11887/Understanding-Generic-Classes.htm
http://www.dotnetspider.com/resources/31000-Binding-Gridview-using-Generics-from-Database.aspx
http://www.dotnetspider.com/resources/20675-Difference-between-Arraylist-Generic-List.aspx
EXAMPLES
---------------------------------
http://www.codeproject.com/KB/aspnet/Generics.aspx
http://www.dotnetjohn.com/articles.aspx?articleid=250
http://www.switchonthecode.com/tutorials/csharp-tutorial-binding-a-datagridview-to-a-collection
-----------------------------------
ABOUT GENERICS
---------------------------
Generic Types
Generics are the most powerful feature of C# 2.0. It allows defining type-safe data structures, without committing to actual data types. In C# 1.0 we can either declare reference type or value type. But in most of the application we come across situation where we need type that can hold both reference & value type. In such situation we use generic types.
Why Generics?
1.
Generic type doesn't care what the type is. We can specify the type at runtime.
2.
It avoids boxing difficulties. In C# 1.0, if we want to put any object into a List, Stack, or Queue objects, we have to take type as System.Object.
3.
It boosts the performance of the application because we can reuse data processing algorithm without duplicating type-specific code.
How Generic implemented:
(1) Generic type is instantiated at run-time not compiled time
(2) Generic type are checked at time of declaration not at instantiation
(3) It works for both reference type & value type.
The System.Collections.Generic Namespace
The System.Collections.Generic namespace contains several generic collection classes based on generics and it is recommended that we should use these collection classes in lieu of the earlier non-generic ones for better performance of our applications.
According to MSDN, "The System.Collections.Generic namespace contains interfaces and classes that define generic collections, which allow users to create strongly typed collections that provide better type safety and performance than non-generic strongly typed collections."
Note that the System.Collections.Generic.ICollection
---------------------------------------------------------
url
http://www.c-sharpcorner.com/UploadFile/abhishekbhatore/GenericTypeWithSample07292005092634AM/GenericTypeWithSample.aspx
--------------------------------
No comments:
Post a Comment