Pages

Thursday, October 25, 2012

spring dependencies for maven


Did you spend lots of time searching for maven dependencies for your spring web application? The following page contains the dependencies for each of the spring module.

http://blog.springsource.org/2009/12/02/obtaining-spring-3-artifacts-with-maven/

Sunday, October 21, 2012

mistake when injecting null value to a variable or construct

Say you need to inject null value to a property. How would you do it? Let me guess.

<bean id="youclassid"class="yourclass">
        <property name="distance" value="null" />
</bean>

Sorry to disappoint you. The above code will not work. The correct way is shown below.


<bean id="youclassid"class="yourclass">
<property name="distance"  /><null/></property>
</bean>


Friday, October 19, 2012

RPC vs Document based webservices in jax-ws

Yeah I know the SOAP based web services are no longer widely used since REST based web services have decreased the usage of SOAP based services. Today how ever I wanted to talk about the differences in two types of SOAP based web services (RPC and SOAP).

RPC based web service with jax-ws

This type of webservices does marshalling and unmarshalling in the SOAP engine. Therefore if the message is large, then the conversion becomes a huge overhead. Hence implementing coarse grained funtionality becomes a problem. Also inter-operatability of this type is not that good plus the support for custom data types is very low since the restrictions on encoding styles. However on the other hand, the implementation of this type of a web service using jax-ws is very simple. And also is good for fine grained functionality. 

Document based web services are have the qualities exactly opposite to the above mentioned rpc based qualities. They are widely used where you need to transfer lots of data using large xml files. 
By comparison however the document based web services are used than rpc based services.

Friday, October 12, 2012

Map/Reduce with mongodb

Well I am not going  write an article by myself here. Because The concept is brilliantly explained in some other article. Visit the link below to have a good understanding about mongo map/reduce feature.
http://www.mongovue.com/2010/11/03/yet-another-mongodb-map-reduce-tutorial/

The following tutorial has a simple cool tutorial on this feature as well.
http://blog.facilelogin.com/2012/02/mapreduce-with-mongodb.html

Tuesday, October 9, 2012

Cool mongodb admin gui panel

I was looking for a mongodb admin panel to use it. Then I found this cool looking java based mongo admin gui panel called Umong.
You can download it from https://github.com/agirbal/umongo/downloads
Just extract the content and run the .sh file using command line or directly. It will launch the admin panel

How to install from unauthenticated sources

Have you seen the following error when you try to update your ubuntu system?
the action would require installation of packages from not authenticated sources...
Well the error is self explanatory. You need to allow unauthenticated sources to get around this. Use the below command to get it work.
sudo apt-get update && sudo apt-get upgrade --allow-unauthenticated
Now you are good to go.


Monday, October 8, 2012

web server vs web container vs application server

web server : is something that is capable of handling http requests (recieving http requesting, processing them, creating http responses and sending them to the clients). Apache Web Server

web container : is a J2EE compliant implementation which provides an environment for the Servlets and JSPs to run. Tomcat typically a web container

application server : is a complete environment for running business components. It contains the web server capabilities as well as web container capabilities. eg: IBM WebSphere, Oracle Application Server

what is node.js?

This is a new technology(started in 2009). The original goal of node.js is to provide push capabilities (read push technology) to websites and make them highly sacalable. These are written in javascript and it's evendriven, asynchronous I/O nature makes it highly scalable.

These are used by big companies like

  • yahoo
  • microsoft
  • linkedin

what is push technology ?

Push technology or server push is used to send information to the client by itself without requiring a request from the client. It goes under the publish/subscribe paradigm. The other frequently used method is pull method where the client sends a request to initiate the transmission.

Applications include most of the emailing systems like gmail etc.... And the famous smtp protocol uses push technology. This technology removes the requirement of polling which has high overhead.
This can be done in several ways.
  1. Http server push : Here the server does not terminate the connection with the client after serving it's request. There fore it can send information to one or more clients easily. This is implemented using CGI in many systems.
  2. pushlets : This is a java technology. It never terminates the response. That is even if the response is sent to the browser, the response is not terminated. Therefore the browser does not know that the content is fully sent. Whenever the server wants to send information, it sends via javascript and eliminates the requirement of java applet. One draw back is it cannot handle the browser timeout. Therefore need to refresh the page periodically overcome the drawback.
  3. long polling : This is like normal polling in a way. client ask for data and the request is sent to server. How ever the server does not send the response until it has some new data. When ever it has new data, it sends a full response to the client. Then again after that the client needs to poll.
Apart from the above there are some other methods as well like flas xml socket relays, xmpp etc...

Wednesday, October 3, 2012

Using third party library and how to handle exceptions?

I think most of you must have come across situations where you need to use third party classes and you need to do some changes. Sometimes you can do this by decompiling the .class file then modifying it. The point is it works some times. But not always. Specially when the code is  obfuscated, chances are very low of decompilling correctly. So how can you overcome this? Well the most suitable method to do this is to use a wrapper class that extends the third party class.

Eg;
///this is the third party class
public class SomeLibrary{
     public void readBook(){

     }
}


Now you can write the wrapper class like this.