Home » Author Archives: Anirudh Bhatnagar

Author Archives: Anirudh Bhatnagar

Anirudh is a Java programmer with extensive experience in building Java/J2EE applications. He has always been fascinated by the new technologies and emerging trends in software development. He has been involved in propagating these changes and new technologies in his projects. He is an avid blogger and agile enthusiast who believes in writing clean and well tested code.

Understanding strategy pattern by designing game of chess

java-logo

Today we will try to understand Strategy Pattern with the help of an example. The example we will consider is The Game of Chess. The intention here is to explain strategy pattern and not to build a comprehensive Chess Game solution. Strategy Pattern : The Strategy pattern is known as a behavioural pattern – it’s used to manage algorithms, relationships ...

Read More »

Pizza problem – builder vs decorator

java-logo

Problem Statement We need to build the software for a pizza company who wants to prepare different types of pizzas, e.g Chicken Pizza, Flat Bread, Pepperoni Pizza with Extra Cheese, put add on toppings on it. Lets try to see which design pattern suits this problem statement and under what scenario. Traditionally, for pizza problem, builder pattern is most commonly ...

Read More »

Configuring chef Part-2

opscode-chef-logo

Lets recap what all we have done in the last blog :                   Setup workstation and chef-repo. Registered on chef to use hosted chef as the chef-server. Bootstrapped a node to be managed by the chef-server. Downloaded the “apache” cookbook in our chef-repo. Uploaded the “apache” cookbook to the chef-server. Added the ...

Read More »

Converting JSON to XML to Java Objects using XStream

json-logo

XStream library can be an effective tool for converting JSON to Java to XML translations to and fro. Lets explore each one of them one by one, and see which driver is used. Handling JSONs To convert JSON to Java objects all you have to do is initialize XStream object with an appropriate driver and you are ready to serialise ...

Read More »

Configuring Chef part 1

devops-logo

Below are the first steps in getting started with using chef. The three main components of chef are :                   Work station This is the developer’s machine will be used to author cookbooks and recipes and upload them to the chef-server using the command line utility called knife. Chef-Server This is the ...

Read More »

Vagrant – a swiss Army knife for every developer

vagrant-logo

Whenever we move to a new project, or we want to explore a new stack of technologies; we face the problem of environments. Being a developer we generally have a tendency to install everything on our local environment; which many times proves to be a disaster. Today, modern web applications involve a lot of moving parts, numerous underlying technologies and ...

Read More »

What are Reentrant Locks?

java-logo

In Java 5.0 a new addition was made to enhance the intrinsic locking capabilities, called as Reentrant Lock. Prior to this, ‘synchronized’ and ‘volatile’ were the means for achieving concurrency.                 public synchronized void doAtomicTransfer(){ //enter synchronized block , acquire lock over this object. operation1() operation2(); } // exiting synchronized block, release lock ...

Read More »

chef-solo with vagrant

opscode-chef-logo

To learn the concepts of chef, we can start by using chef-solo with Vagrant. See my previous post on Vagrant to install vagrant and know more about it. Next, lets install chef-solo on our machine. We will install chef-solo using ruby gem, make sure you have ruby installed.             root@intro:~# cd ~ root@intro:~# sudo gem ...

Read More »

Create an Ubuntu VM Using Vagrant and Virtual Box

vagrant-logo

I have been using Vagrant for some time with virtual box to play around with vms on my ubuntu machine. Vagrant is a tool to help create and provision VirtualBox machines.Few of the reasons for using it would be: The development environment can be isolated from all the other junk that accumulates on my primary computer. The development environment can ...

Read More »

HTTP Caching explained

software-development-2-logo

We all have noticed that opening of a webpage for the first time takes some time, but the second or third time it loads faster. This happens because whenever we visit a webpage for the first time, our browser caches the content and need not have to make a call over the network to render it. This caching ability of ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close