Showing posts with label J2EE. Show all posts
Showing posts with label J2EE. Show all posts

Friday, February 18, 2011

Why do we need JMS?

What is JMS(Java Message Service)?

A specification (API)  that describes a common way for Java programs to create, send, receive and read distributed enterprise messages. Its basically meant for object communication in multithreaded & heterogeneous environment.

It enables
  • loosely coupled communication (not like RMI or CORBA)
  • Asynchronous messaging
  • Reliable delivery (a message is guaranteed to be delivered once and only once)





Best examples where we can use JMS are “Enterprise Chat Application” & “Stock Trading Application”.

All the major vendor (IBM, Oracle, Apache, Google etc) has given its implementation. Its also available as a add-on of application server like Oracle Weblogic Server, JBOSS etc.

Why do we need it?

It will be useful when you are writing some event based applications like Chat Server which needs a publish kind of event mechanism to send messages between the server to the clients who got connected with the server.

Its different from RMI, in JMS there is no need for the destination object to be available online while sending a message from the client to the server. But in RMI it is necessary. So we can use JMS in place of RMI where we need to have loosely-coupled mechanism.

Conclusion

JMS is the distributed enterprise messaging API. You can use these API in order to develop your own application or you can 3rd party implementation like IBM MQServies.  We will choose JMS if there is a requirement of enterprise messaging application that requires to send/receive huge number of messages in reliable environment.



Thursday, November 4, 2010

Struts2 Analysis

Recently i got the chance to work on struts2. Briefly, its a J2EE MVC web framework like struts-1, JSF, ADF etc. During development, I found following its pros and cons:-

Pros:
1. Excellent support for Spring, Freemarker, Tiles, AJAX, JQuery etc.
2. Very easy to understand as compared to Struts-1, JSF & ADF
3. Highly configurable & extendable framework
4. Builtin support for token generation,Internationalization etc
5. Good abstraction away from Servlet/JSP
6. Struts2 tags are simpler to use
7. Good builtin Validation framework
8. New version of MyEclipse 8.6 has builtin support for Struts2
9. Good management of properties files like global level, package level and action level

Cons:
1. Poor documentation.
2. Struts2 themes make the framework harder to understand and slower. In order to develop or update themes, someone must know Freemarker language.
3. Immature internationalization support.Tags not fully support of localization.
4. Interceptors are not flexbile enough as compared to Filter. As you can not define interceptor in web.xml alongwith parameters.
5. No builtin pagination and data grid support.
6. Problem in localization for display tag