Java Code Geeks » Anirudh Bhatnagar http://www.javacodegeeks.com/ Java 2 Java Developers Resource Center Sat, 25 Apr 2015 12:00:30 +0000 en-US hourly 1 http://wordpress.org/?v=4.2 Understanding strategy pattern by designing game of chesshttp://www.javacodegeeks.com/2014/10/understanding-strategy-pattern-by-designing-game-of-chess.html http://www.javacodegeeks.com/2014/10/understanding-strategy-pattern-by-designing-game-of-chess.html#comments Wed, 22 Oct 2014 04:00:15 +0000 http://www.javacodegeeks.com/?p=31869 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 ...

 

]]>
http://www.javacodegeeks.com/2014/10/understanding-strategy-pattern-by-designing-game-of-chess.html/feed/ 1
Pizza problem – builder vs decoratorhttp://www.javacodegeeks.com/2014/08/pizza-problem-builder-vs-decorator.html http://www.javacodegeeks.com/2014/08/pizza-problem-builder-vs-decorator.html#comments Mon, 25 Aug 2014 19:00:33 +0000 http://www.javacodegeeks.com/?p=29258 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, ...

 

]]>
http://www.javacodegeeks.com/2014/08/pizza-problem-builder-vs-decorator.html/feed/ 4
Configuring chef Part-2http://www.javacodegeeks.com/2014/07/configuring-chef-part-2.html http://www.javacodegeeks.com/2014/07/configuring-chef-part-2.html#comments Mon, 21 Jul 2014 04:00:34 +0000 http://www.javacodegeeks.com/?p=27848 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 ...

 

]]>
http://www.javacodegeeks.com/2014/07/configuring-chef-part-2.html/feed/ 0
Converting JSON to XML to Java Objects using XStreamhttp://www.javacodegeeks.com/2014/07/converting-json-to-xml-to-java-objects-using-xstream.html http://www.javacodegeeks.com/2014/07/converting-json-to-xml-to-java-objects-using-xstream.html#comments Thu, 17 Jul 2014 10:00:29 +0000 http://www.javacodegeeks.com/?p=27859 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 ...

 

]]>
http://www.javacodegeeks.com/2014/07/converting-json-to-xml-to-java-objects-using-xstream.html/feed/ 0
Configuring Chef part 1http://www.javacodegeeks.com/2014/07/configuring-chef-part-1.html http://www.javacodegeeks.com/2014/07/configuring-chef-part-1.html#comments Thu, 10 Jul 2014 07:00:51 +0000 http://www.javacodegeeks.com/?p=27596 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 ...

 

]]>
http://www.javacodegeeks.com/2014/07/configuring-chef-part-1.html/feed/ 0
Vagrant – a swiss Army knife for every developerhttp://www.javacodegeeks.com/2013/12/vagrant-a-swiss-army-knife-for-every-developer.html http://www.javacodegeeks.com/2013/12/vagrant-a-swiss-army-knife-for-every-developer.html#comments Sat, 07 Dec 2013 13:00:22 +0000 http://www.javacodegeeks.com/?p=19329 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 ...

 

]]>
http://www.javacodegeeks.com/2013/12/vagrant-a-swiss-army-knife-for-every-developer.html/feed/ 0
What are Reentrant Locks?http://www.javacodegeeks.com/2013/11/what-are-reentrant-locks.html http://www.javacodegeeks.com/2013/11/what-are-reentrant-locks.html#comments Fri, 01 Nov 2013 08:00:11 +0000 http://www.javacodegeeks.com/?p=18592 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(); } // ...

 

]]>
http://www.javacodegeeks.com/2013/11/what-are-reentrant-locks.html/feed/ 0
chef-solo with vagranthttp://www.javacodegeeks.com/2013/10/chef-solo-with-vagrant.html http://www.javacodegeeks.com/2013/10/chef-solo-with-vagrant.html#comments Fri, 25 Oct 2013 19:00:31 +0000 http://www.javacodegeeks.com/?p=18413 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:~# ...

 

]]>
http://www.javacodegeeks.com/2013/10/chef-solo-with-vagrant.html/feed/ 0
Create an Ubuntu VM Using Vagrant and Virtual Boxhttp://www.javacodegeeks.com/2013/10/create-an-ubuntu-vm-using-vagrant-and-virtual-box.html http://www.javacodegeeks.com/2013/10/create-an-ubuntu-vm-using-vagrant-and-virtual-box.html#comments Thu, 24 Oct 2013 07:00:34 +0000 http://www.javacodegeeks.com/?p=18403 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 ...

 

]]>
http://www.javacodegeeks.com/2013/10/create-an-ubuntu-vm-using-vagrant-and-virtual-box.html/feed/ 1
HTTP Caching explainedhttp://www.javacodegeeks.com/2013/10/http-caching-explained.html http://www.javacodegeeks.com/2013/10/http-caching-explained.html#comments Wed, 23 Oct 2013 19:00:26 +0000 http://www.javacodegeeks.com/?p=18401 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 ...

 

]]>
http://www.javacodegeeks.com/2013/10/http-caching-explained.html/feed/ 0