Monthly Archives: June 2013

Factory Pattern

Factory Pattern is one of the highly used design patterns. The reason being , its genuine usefulness and closeness to real world. Let’s take a very simple real world example to get started, and then we will map it to the pattern.

Let’s say we have a Car factory which creates many types of cars. To keep it simple, let’s say it creates 2 type of cars- hatchback & sedan. These two type of cars will have many similar attributes like top speed, power steering etc. but there will be some features explicit to type of car (say a back seat AC or TV is available only for sedan cars). What will be a natural Object Oriented Design for this arrangement?

Class Car Extended by Class Sedan and Class HatchBack

If you know what type of car you need beforehand, we are good. But in case you need to create the car at runtime, say on user input, you will need some helper class which will create specific type of car at runtime. This class is our factory class.

factory

Class CarFactory

{

Public static Car getCar(String carType){

If(carType.equals(“sedan”)) return new Sedan();

else return new HatchBack();

}

}

A better example in technical terms might be that your application supports multiple database types (say on test environment you use MySql whereas on production you have Oracle). A DataBaseConnectionFactory can help you get connection of specific type of database at runtime (say reading the database type value from some property file.

 

BigData and the hype

You must be hearing a lot of noise around the term BigData these days. What exactly is big data and how is it impacting the tech world?

As the name suggests, it is about data, a lot of data, huge data. What’s new? The amount and type of data. Data mining has already been an important part of any company right now, it helps them understand current trends and predict future upto a certain level. With BigData coming in, the concept is stretched further.

Let’s take an example, an ecommerce website wishes to understand customer behavior to improve its reputation and responsiveness. Where can it find the data, past sales, logs, customer activity on the website, blogs, facebook, twitter, google plus.. phew, that is tones of data. But the more data you can collect, a better decision you can make.

The challenges include- collection of data, search the relevant data, storage and most importantly the analysis i.e. conversion of raw data to useful information. Think about it, if a company can convert all the raw data related to its brand available on the various arenas to useful information like what people think about it, what are their exceptions, how to improve user experience etc, it will be a big win for the company.

Related post: http://kamalmeet.com/2013/03/infosys-launches-big-data-edge/

Samsung Galaxy Note 2

I have been using samsung galaxy note 2 for more than 6 months now, so thought of sharing some highlights which might help others in making a choice when buying a similar phone.

Screen Size: This is the best thing about this phone. The phablet provides you with a screen in which reading emails/ ebooks is very easy. For the first time I am able to read ebooks so easily on my phone.

Sleek: When I bought note 2, I had a doubt that if it will be easier to carry it along because of the screen size. But sleek width and light weight helps me carry it easily in my pocket.

Speed: Another good thing about this 1.6 GHz phone is I have never seen this slow down or hang, no matter how many applications are in process.

Battery Life: Amazingly the phone’s battery life is much better than I expected. My last Android phobe had a battery life of 1.5 days, but note 2, even with a big screen, can give me more than 2 days easily with regular usage.

Navigator: The big screen helps me use navigate feature of android very easily, it has helped me find out easy routes and alternatives for many destinations.

Camera: With 8 Megapixel camera and great flash, I have not carried a camera in any of my trips since I bought this phone.