A Presentation on Collections
What are Collections Collections are the group of similar and dissimilar objects.Thorugh collections we can implement different various structures. Collections implement various classes as well Collections provide a way to store arbitrary objects in a structured fashion, and we all know how useful they are in everyday programming.
Need of Collections 1.Gives Non Persistent Data Structure. 2.It provides specialized classes for data storage and retrieval.  3. The interfaces may be inherited to create new collection classes. 4. Well tested and efficient methods are provided so user does not have to spent time in constructing methods.
Types of Collections:- Non Generic Collections   System.Collections Generic Collections   System.Collections.Generic Note:
Non Generic  Collections These Collections contains interfaces and classes that define various collections of objects, such as lists, queues, bit arrays, hash tables and dictionaries  Non Generic Collections are not type safe the data we supply is converted to object. It implements one or more of the ICollection,IDictionary,IEnumerable,IComparable and IList interfaces.
Categories of Non Generic  Collections Ordered collections:  The Stack and Queue classes are both examples of Ordered collections implementing ICollection Interface.  Indexed collections:  Array List class is one example of an indexed collection implementing IList Interface.  Keyed collections:  The Hash Table class is one example of an Indexed Collection that implements the IDictionary interface.
Generic Collections It allow users to create collections that provide better type safety and performance than non-generic strongly typed collections .Applications that target version 2.0 and later of the .NET Framework should use the generic collection classes Example :- instead of using the Hashtable class, which allows keys and values to be of any type, you can use the Dictionary generic class and specify the type allowed for the key and the type allowed for the value.
 
Generic vs. Non Generic Collections Non-Generic   Similar Generic Type  ArrayList   List<T>  Hashtable   Dictionary<TKey,TValue>  SortedList  SortedList<TKey,TValue>  Queue  Queue<T>  Stack  Stack<T>  N/A   SortedDictionary<TKey,TValue>  N/A  KeyedCollection<TKey,TItem>  N/A  LinkedList<T>
 
Conclusion Collections are a vital element of any object-oriented architecture. Offering the capability to group objects in logical constructs, they improve code readability and self documentation, as well as enhance maintainability.   As we see that collections reduces the Programming effort and increases program speed and Quality so it is always a good practice to use collections.

Collections

  • 1.
    A Presentation onCollections
  • 2.
    What are CollectionsCollections are the group of similar and dissimilar objects.Thorugh collections we can implement different various structures. Collections implement various classes as well Collections provide a way to store arbitrary objects in a structured fashion, and we all know how useful they are in everyday programming.
  • 3.
    Need of Collections1.Gives Non Persistent Data Structure. 2.It provides specialized classes for data storage and retrieval. 3. The interfaces may be inherited to create new collection classes. 4. Well tested and efficient methods are provided so user does not have to spent time in constructing methods.
  • 4.
    Types of Collections:-Non Generic Collections System.Collections Generic Collections System.Collections.Generic Note:
  • 5.
    Non Generic Collections These Collections contains interfaces and classes that define various collections of objects, such as lists, queues, bit arrays, hash tables and dictionaries Non Generic Collections are not type safe the data we supply is converted to object. It implements one or more of the ICollection,IDictionary,IEnumerable,IComparable and IList interfaces.
  • 6.
    Categories of NonGeneric Collections Ordered collections: The Stack and Queue classes are both examples of Ordered collections implementing ICollection Interface. Indexed collections: Array List class is one example of an indexed collection implementing IList Interface. Keyed collections: The Hash Table class is one example of an Indexed Collection that implements the IDictionary interface.
  • 7.
    Generic Collections Itallow users to create collections that provide better type safety and performance than non-generic strongly typed collections .Applications that target version 2.0 and later of the .NET Framework should use the generic collection classes Example :- instead of using the Hashtable class, which allows keys and values to be of any type, you can use the Dictionary generic class and specify the type allowed for the key and the type allowed for the value.
  • 8.
  • 9.
    Generic vs. NonGeneric Collections Non-Generic  Similar Generic Type ArrayList  List<T> Hashtable  Dictionary<TKey,TValue> SortedList SortedList<TKey,TValue> Queue Queue<T> Stack Stack<T> N/A  SortedDictionary<TKey,TValue> N/A KeyedCollection<TKey,TItem> N/A LinkedList<T>
  • 10.
  • 11.
    Conclusion Collections area vital element of any object-oriented architecture. Offering the capability to group objects in logical constructs, they improve code readability and self documentation, as well as enhance maintainability. As we see that collections reduces the Programming effort and increases program speed and Quality so it is always a good practice to use collections.