Hello? This is Jayon.
Today, we will examine the definition and characteristics of JCF.
What is JCF?
JCF stands for Java Collections Framework, and it represents a set of classes that provide a standardized way to easily and effectively handle multiple data. In other words, it is a structured implementation of data storage structures and data processing algorithms as classes. Here, Collections can be thought of as a set or group of data.
Framework vs Library
A framework can be described as a 'set of classes and interfaces that cooperate to solve a specific software problem', and it is not a complete application but rather a task that programmers need to complete. On the other hand, a library refers to a set of readily usable tools.
To explain the difference between the two in more detail, the framework controls the overall flow itself, and the user inserts the necessary code within it, while the library allows the user to create the overall flow and utilizes the library.
Background of JCF Introduction
Before the introduction of JCF, the standardized methods for grouping (Collection) Java objects were Arrays, Vectors, and Hashtables, and these Collections did not have any common interfaces. Therefore, even if the purpose of using these Collections was the same, there was a problem that each had to be defined separately. And since each Collection had different methods, syntax, and constructors, it was easy for developers to get confused while using them.
As shown in the code above, even though the purpose of simply inserting elements and finding and printing them is the same, the syntax used for each is different. For example, when inserting elements, vector uses addElement(), and Hashtable uses put().
Therefore, Java developers designed a common interface to solve this problem, which is the Java Collections Framework that we will introduce today. For your information, with the advent of JCF, Vector and Hashtabls became legacy classes and are no longer used today.
Advantages of JCF
(1) Code reuse is easy.
(2) Provides high-performance implementations of data structures and algorithms, improving program performance and quality.
(3) Provides interoperability between unrelated APIs.
(4) Reduces the time it takes to learn and design new APIs.
(5) Promotes software reuse. This is because new data structures that use JCF are reusable, and for the same reason, new algorithms can be created using objects that use JCF.
Summary
So far, we have learned the meaning of JCF, why it was introduced, and its advantages.
Next time, we will discuss the hierarchical structure of JCF.
Comments0