Wednesday, January 25, 2012

Jackson as Binding Framework for JSON

 

For folks who have used JSON as the message format between different tiers of your application, identifying the best possible binding framework must have been tough. With maturity coming into play with time for JSON, there are a host of binding engines. One of the fastest and lightweight I came across is Jackson. Yes you heard it right – that’s the name of the framework!

 

JSON shows a lot of promise due to its low payload size and structure and frameworks to support it will soon pick up steam. Now let’s get down to some results.

 

Jackson is a multi-purpose Java library for processing JSON. Jackson aims to be the best possible combination of fast, correct, lightweight, and ergonomic for developers.

 

Consideration Points

·         Performance oriented framework and lightweight

·         Fastest marshaling / unmarshalling processing

·         Supports Annotations

·         Supports utilization of generated models with ease (with mix-in annotations)

·         Jackson JSON processor is by default an Open Source product, available under: Apache License (AL) 2.0 & LGPL 2.1

·         Joda date time library support

·         Hibernate data type support

·         Supports non-Java JVM languages also e.g. Groovy, Scala, Clojure

·         Relatively more active project vs other frameworks available in market

·         Clean specifications available

 

 


 

Considering the "bigger is better" aspect -- value measured, "tps", is number of documents read, written, or read-modify-written per second -- difference from slowest (google-gson) to fastest (Jackson) is a solid order of magnitude.

 

 

Thursday, February 18, 2010

Mobile Travel Apps - On What?

Recently, there has been a lot of traction to woo customers towards exposure of their applications wirelessly over mobile devices. It is the righ

Tuesday, September 15, 2009

Augmented Reality - Wanna see more than what’s real !

While I do like writing sometimes, but I have the greatest excuse in the world of not finding time for it. Well, I had received an email a couple of days back on a gadget which actually uses the same concept and I, for a moment thought that perhaps this is a good push to kickstart my blogging career.

Well, Augmented Reality(AR) is nothing new and has been around for sometime but the level at which it is being applied today might well be the next GPS-like revolution. From the word itself, Augmented which means increased, the meaning converts to increased level of reality. This level of reality is achieved by mixing the real-world data with statistics and information generated by the computer system. Hence, the result is a mixed reality which is better than the real object in view. This augmentation is possible with advanced sensors, actuators and navigation systems which today is even available in mobile handsets. AR sits between reality and vituality.

As a matter of fact Google have utilized an AR API in their Android phone to develop AR applications.

Here are some examples I wanted to share:

A google device which scans for a fruit and provides information on the nutritional values:



The same device translates language realtime:


A G1 phone which has a camera, compass & GPS receiver which knows where you are and where to guide you to for a restaurant or ATM:


Contact Lens powered with AR ready to see more than the reality in front:


Vehicle cameras which can provide more information than just the road ahead:



Looks like AR is here to stay and will replace lot of keyboards and punches in GPSs and computer systems. With the voice recognition and voice enabled devices getting the final touches after years of improvements, it's not far when we can do and find things without typing at all.
Reblog this post [with Zemanta]

Using Dynamic DB configuration based on the current value of Environment Variable in XML

A graphical depiction of a very simple xml doc...Image via Wikipedia

It has been a constant endeavor to segregate code dependency and provide loose coupling to ensure the same. That’s where XML comes into the picture helping us dynamically configure attributes required during runtime.

Here I have shown how to dynamically pull values from an environment variable and then use it in an xml file, thereby further promoting it for code usage. This is a common situation in environmental infrastructures, and code would depend on the current environment to build on the outgoing URLs/databases/queues/etc etc


Let’s take the picture of an app deployment which would connect to environment-wise database servers. We will assume that we will have a ENV_VAR user/system variable already defined on the box.

I have utilized spring’s PropertyPlaceholderConfigurer to feed a properties file which will contain the various db configs environment-wise:

<spring:beans>

<spring:bean class="org.springframework.beans. factory.config.PropertyPlaceholderConfigurer">

<spring:property name="location" value="classpath:dbconfig.properties"/>

</spring:bean>

</spring:beans>

Content of properties file(dbconfig.properties) with sample values:

devurl=jdbc:db2://someIP:30000/DB

devuser=username

devpass=password

produrl=jdbc:db2://someIP2:30000/DB

produser=user1

prodpass=pass1

Then in the xml config where we define the database configuration I picked up these dynamic values using:

<spring:property name="url" value="${${ENV_VAR}url}" />

<spring:property name="username" value="${${ENV_VAR}user}" />

<spring:property name="password" value="${${ENV_VAR}pass}" />

ENV_VAR should be an environment variable in each box i.e. ENV_VAR =dev for DEV box, ENV_VAR=prod for PROD blades etc

While server startup the values are picked up dynamically from the properties file depending on the value of the ENV_VAR environment variable on the application server box.

Thanks,

Yassar

Ø Email Blog

Reblog this post [with Zemanta]

Thursday, February 12, 2009

Been Long Since....

Hi Guys,

Its been quite long since I pen-ned something! I have been quite busy but that's one excuse anyone can make - isn't it? So I have a made a resolve to regularly write on my activities. Lately I have been to places around US - perhaps that could be a good topic to start off with!

Will start soon...

Take care.

Thursday, April 17, 2008

Green Earth? Where are we heading?

Its time we ruminated further over our chances of creating a greener & healthier planet. With the economic rise globally, its tough to minify on the emission & pollution control front. The emerging world economies, while gaining pace towards development have forgotten what menace we are upto, if we are not able to control our environment.

Developing countries, particularly India & China have been polluting the environment in the race for supremacy as global economy drivers. The harm that we are doing to the climate via the industrial emission, vehicle pollution, waste production, etc is not being conceived at a granular level. Will we have a planet to live in 100 years is a question unanswerable by even the most experienced scientists & individuals. The smoke, pollutants, gas, etc is producing enough trauma for our environment. 80% of this destruction is being caused by the the top 17 developed/developing nations.


In the most recent climate control seminar where all the major economic leaders participated, it was decided not to let go off of this severe menace silently biting our planet. Has this been taken seriously by all is still a question. The consequences at the granular level in these nations will clearly answer for itself.

Folks, its time we agree on it & take a step forward to save future lives. How can we? The initiative has to come from within us & further more from our government.

Tuesday, April 15, 2008

An Amazing Vacation !

This winter we planned for a trip to a hill station! Well, you would say what a bizarre idea but fortunately it turned out to be an amazing experience (even though it was dead cold on the hills ;-) ). Our trip lasted 10 days from Kolkata to Delhi through Shimla/Manali & back to Kolkata. Even though it was quite a hectic tour, yet we enjoyed every moment of it. Each destination we visited was unique in its own way & had its own enamor & enchantment. Right from the moment we had a sight of the all so special Taj mahal at Agra to the bright & fresh snow covers of the peaks of Manali, it was a treat for the eyes.

It was my third visit to the Taj but the Taj Mahal in all its grandeur mesmerized me yet again with its architectural & romantic beauty. The dainty looks & the grandness of the monuments becharms every tourist.

Manali on the other hand fascinated us with it vividly brilliant snow covers. The beauty of the mountains intrigues me due to its physical & natural attributes. The change of climate & weather refreshed my mind & body away from the hustle & bustle of the polluted cities.

Given a chance & a welcome break, I'll surely shoot for another trip of a hill station - perhaps not during winter ;-) !

Here are some wonderful captures of the trip.