Refresh Your Java - Before Java Interview
We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....
Caching plays vital role in real time development,
Caching is nothing but
storing Static
or very rarely changed data in memory or
on disk to avoid unnecessary delays for fetching
data
from different sources.
This one of the very important Technique that people to use improve performance
of your application.
Here are some examples for caching .
i) User Data
and Roles :
In most of the applications, every User is
associated with a set of different roles based
on which
they are allowed to perform certain tasks.This User-Role data will
not be changed
very frequently so this could be loaded
into-memory (Cached) upon sever start up. Whenever
it is required to check if the User is authorized to perform
certain task , we could get the
Role data from Cache
instead of getting from DataBase, this could avoid unnecessary
Trips
to DataBase and improves the Performance.
ii) Product And Offer Data:
In same
way in most of the Sales-Ordering systems , Productions and Offer
Data would not be
changed very frequently , so SKU data
and Pricing data etc, could be cached
for better
performance .
Techniques:
Singleton
classes:
Just create the Singleton classes and
cache the static data by using Java Collection APIs
such
as Hashmap or List .
Java Caching APIs:
Use the
Caching APIs such as EHCache, JCache etc.,
HttpSession:
You could store the data in user Session.
This Portal is intended to put all Java/J2ee related topics at one single place for quick referance, not only Technical , but also the Project Management Related thing such as Development Process methodoogies build process, unit testing etc.,
This Portal has More than 500 Java Interview Questions (also could be Considered as Quick Notes) very neatly separated topic by topic with simple diagrams which makes you easily understandable. Importantly these are from our Realtime expericance.