Collection

What Does Collection Mean?

In programming, a collection is a class used to represent a set of similar data type items as a single unit. These unit classes are used for grouping and managing related objects.

Advertisements

A collection has an underlying data structure that is used for efficient data manipulation and storage. Code readability and maintenance improves when collections are used in logical constructs.

Techopedia Explains Collection

Collections are designed to group certain objects with a logical connection. For example, a StudentCollection object may be used to maintain university student details. Details may include the total number of students or offer a student search facility based on attributes, such as name, class or grade.

Collections are used under the following conditions:

  • Each group element represents an object with a similar purpose.
  • Group size varies dynamically during runtime.
  • There must be access to an individual element through a search function based on a specific key.
  • There must be a sort or iteration through the group elements.

The .NET Framework provides a number of collection types, such as an array list, linked list, stack, queue or dictionary. Custom collections may be used when there is an implementation requirement for a special or new data structure. This may be done to host specific types, improve performance or modify by overriding existing collection class functionality. Using custom collections in the application architecture involves additional development resources.

Selecting the right type of collection is based on the usage pattern of a collection. Examples include dictionary collection, queue, stack, sorted dictionary and generics.

Advertisements

Related Terms

Latest Data Management Terms

Related Reading

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…