DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Data
  4. Collection Framework: Missing Concepts

Collection Framework: Missing Concepts

Vijay Shanker user avatar by
Vijay Shanker
·
Sep. 27, 12 · Interview
Like (0)
Save
Tweet
Share
5.44K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction 


My first encounter with the collection framework was on my second day of Java programming. The collection framework has many implementations, and each of these is solving some very specific need of the data structure. There was a lot of information about every use case and its optimal collection implementations, but now, after four years, I still have to go through the same process when there's a decision to make about collection use.

Deciding which collection to use is often one of the most important decisions to make when designing a program. By definition, a collection provides means for storing and manipulating groups of data as a single unit. This single unit is called a collection -- it's sometimes also called a container.


The Container 


In object oriented programming, container is defined as a class capable of storing other objects. These classes usually implement some kind of data structure such as map, set, stacks, etc. The size of the collection of objects is adjusted automatically in a container class. A container can be divided into two groups:

  1. Value based containers
  2. Reference based containers


Value-Based Containers 

Value-based containers store copies of objects. If we access an object, an object returns a copy of it. If external object is changed after it has been inserted in container, it will not affect the content of the container at all.

Reference-Based Containers 

Reference-based containers store pointers or references to the object. If we access an object, an object returns reference to it. If external object is changed after it has been inserted in container, it will also affect the content of the container.


The Study 


Further to this, the container can be studied under three points of views.

Access

It means accessing the container elements. In case of arrays accessing is done using array index. For stacks, access of elements is done using LIFO (Last In First Out) and in queues it is done using FIFO (First In First Out).

Storage 

It includes storing of items of containers. Some containers are finite containers and some are infinite containers.

Traversal 

It includes how the item can be traversed.

The Summary 

Now, look for the collection with above concepts imprinted in brain. Selection of the correct container data structures in a program can do wonders.

  1. It can make the code a hundred times faster.
  2. Help in to reduce memory requirements 
  3. To make the source code cleaner (in turn making it easier to write, debug, and expand). 

Typically, the most commonly used data structures are ones which are implementations of abstract data types (containers). Whereas, an abstract data type (ADT) specifies what operations can be performed on a data structure. A data structure is the concrete implementation of ADT, specifying how much memory is required and, crucially, how fast the execution of each operation will be.
Container Concept (generic programming) Framework Object (computer science) Data (computing) Data structure Abstract data type

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • The Top 3 Challenges Facing Engineering Leaders Today—And How to Overcome Them
  • How to Cut the Release Inspection Time From 4 Days to 4 Hours
  • When AI Strengthens Good Old Chatbots: A Brief History of Conversational AI
  • 5 Challenges in Building Distributed Systems

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: