Prefer try-with-resources to try-finally

The Java libraries include many resources that must be closed manually by invoking a close method. Examples include InputStream, OutputStream, and java.sql.Connection.  While many of these resources use finalizers as a safety net, finalizers don’t work very well.  For a long time, a try-finally statement was the best way to guarantee that a resource would be closed properly, even in the face … More Prefer try-with-resources to try-finally

DDD Terminologies

Terminologies are always an important part of understanding any design pattern. Below are some of  the important terms that we come across on a daily basis if we are implementing our application in DDD way. You can read more about DDD in our previous articles here.   Ubiquitous language: – In DDD world, Its a … More DDD Terminologies

Use of ‘this’ in Java

this keyword is a pet name for the current instance within a class. In other word, this is a reference variable that refers to the current object. this does not really affect end code. It is a compile time operator and the code generated with or without it, will remain the same. Where you have to use it, that totally … More Use of ‘this’ in Java

What is Value Objects

A Value Object is something that hold values but not the identity. Value Object is an immutable type that is distinguishable only by the state of its attributes. i.e. Two Value Objects will be considered same if they share all of their attributes. Value Objects has all the properties of an immutable object like String … More What is Value Objects