In another post, “Do I Really Need a Singleton?”, I wrote about the problems introduced by the Singleton design pattern. When the single unique instance is being accessed through the getInstance() method, Singleton acts as a global variable in disguise and introduces tight coupling and unwanted dependencies. I have received two immediate questions from my … Continue reading Inject Dependencies – Manually
Recap: Exception Hierarchy In Java In Java, we have three types of Throwables : Error and it’s subclasses Runtime Exception and it’s subclasses And the rest (Non-Runtime Exceptions) Exceptions those lie in the third category are called Checked Exceptions. If a method throws a checked exception, the compiler makes sure that the API user handles … Continue reading Problems with Checked Exception in Java
How to configure and use JMeter for load/traffic testing of Web Applications.
Recently I have published a post on "Static Vs Singleton". While working on the topic, I slipped into another: “Are Singletons really that bad?”. I started reading further. Trust me, it’s a holy war! And here is the result of my investigation. To start with let’s take a look of the definition of the pattern. … Continue reading Do I really need a Singleton?
Is Singleton a pattern with all good? I am afraid. The answer is NO!
The other day, a friend of mine asked me the question “What is the difference between a Java process or thread?” My instant reply was, thread is a light weight process. But of course it was not a complete answer.