Good article about JVM – Heap memory, Garbage collection and other Java related articles.
10 points about Java Heap Space or Java Heap Memory
http://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html#.TjMNBluRoRQ
Software Architecture Made Easy
Good article about JVM – Heap memory, Garbage collection and other Java related articles.
http://javarevisited.blogspot.com/2011/05/java-heap-space-memory-size-jvm.html#.TjMNBluRoRQ
Why RDBMS (SQL):
Why MongoDB (No-SQL):
In nutshell, if you have simple data without any complex relationship then why to choose complex RDBMS. Both are not replacement of each other, both have their own importance. I think it will be helpful to understand use cases of these two databases.
ArrayList – orderd, fast iteration and fast random access.
LinkedList – orderd,fast insertion and deletion
HashSet – unsorted, unordered Set. no duplicates and you don’t care about order.
LinkedHashSet– orderd, Use this class instead of HashSet when you care about the iteration order.
TreeSet– Sorted.
HashMap– unsorted, unordered. don’t care about the order.
LinkedHashMap– maintains insertion order (or, optionally, access order). slower than HashMap for adding and removing elements, you can expect faster iteration with a LinkedHashMap.
TreeMap – Sorted. TreeMap lets you pass your own comparison rules in when you construct
I have most of the times worked on spring based projects. Recently I got a chance to design business layer based on EJB 3.
Below are the observations based on my experience.Any architect may consider EJB 3 , for these aspects.
You can achieve all the features with other frameworks as well, but one need to develop custom components or integrate other frameworks, while these features are embedded in EJB 3 and can be applied easily.
To ensure security of a web application is an important requirement now days. One needs to first do a vulnerability assessment.
For example:
One practice can be to setup some design and development guidelines to ensure that application is secure to at least common vulnerabilities. Please read more at http://makesecurejava.blogspot.in/
When to Use:
We can use Singleton pattern while creating objects of thread pools, caches etc to avoid wasting resources. If you want to store global information like item price of products etc. It’s now a anti-pattern and you should avoid it by different substitutes.
Important Note: It has now become Anti-design pattern and we should avaoid by using follwoing techniques:
1. Dependency Injection
2. Using Factory design Pattern
3. Using Enum class etc. (Introduced in Java 1.5)
// Enum singleton - the preferred approach public enum MySingleton{ INSTANCE Consolas, Monaco, monospace; }
Singleton Design Pattern in a clustered Environment [Source: http://www.techspot.co.in/2009/07/singleton-in-cluster.html%5D
In a multiple JVM’s environment, each of them will have their own copy of the singleton object which can lead to multiple issues specially in a clustered environment where the access to the resource needs to be restricted and synchronized.
To achieve clustering across multiple JVM’s, one can use multiple techniques (JMS, DB, Custom API, 3rd party tools), but each of them have an impact on the business logic.