Saturday, 3 December 2016

Introduction Of Collections Framework In Java

Hello Friends, here we are going to start a very important topic for Java Programmar.So, Our Topic name is Collection Frammaramework.


Defination and Need Of Collection
Let's first see the defination of Collection Framework in Context of Java.

Collection is a java object that is used to group homogenous and hetrogenous, duplicate and unique objects without size limitation for carring multiple object at a time from one application from another application among multiple layers of MVC architecture as method argument or return type.



Introduction of java.util package

java.util package contains multiple classes to group same or different type objects without size limitation. These classes are usally called as Collection Framework Classes.

Now the question comes here, If we have already object[] to group hetrogenous objects then why Collection?

So, now let's see the problem behind object[] to collect object.
  1. It is fixed in size.

To solve fixed size proble we should write code for array that can automatically increase the size of array when it comes to it's peak level. That will take huge efforts of a developer. To solve the above problem SUM MICROSYTEM decided to implement collection classes to every java project with high performance.

All the collection classes package defined under java.util package.  there are some important classes of regular use.

LinkedList                HashSet                                   HashMap
ArrayList                  LinkedHashSet                       LinkedHashMap
Vector                       TreeSet                                   TreeMap
Stack                                                                            HashTable
                                                                                      Properties


Here, one question always hits our mind, Why it named as Collection Framework.

Framework is a semi-finished reusable application which provides some common low level services for solvinf reoccuring problems and that can be customized according to our requirment. let's see some example here.

1. Computer is a Framework, It can be used by all peopleaccording to their requirment.
2. Switch board is a Framework, It can be used by people according to thier requirment.
3. In java, Java EE, JSF, Struts, Spring technologies are frameworks, all tese technology is sued by different companies for developing different projects.

The collection Framework provides low level serviced with well defined data structure to slove collection hetrogenous  dynamic number of objects as a single entity. Due to these reason java.util package classes are collectively called Collection Framework.

Important Note
All collection classes are implementing from java.io.Serializable so the collection object along with all its internal object can be stored in local file system or can be sent across network to remote computer.Here rule is objects stored in collection are also should be serializable types to store collection in file.
--------------------------------------------------------------------------------------------------------------------------
In next post we will continue Collection more theory points.
Thanks(SmartiesGeeks)

No comments:

Post a Comment

Make Top Rank Blog