I am Siva, a passionate java developer, open source enthusiast, blogger. I like to cover Java, Struts, Spring, Hibernate, Ajax Tutorials, How-To's and Best Practices. Sivaprasadreddy is a DZone MVB and is not an employee of DZone and has posted 36 posts at DZone. You can read more from them at their website. View Full User Profile

Utilities for Java Apps

  • submit to reddit

 Java is better programming language for building web and enterprize applications with its matured APIs and tons of frameworks to make easier and faster the development. Now we have 100s of frameworks in each area like for web app development we have Struts 1.x/2.x, SpringMVC, JSF etc, for middle tier we have Spring, EJB3, for Ajax based apps we have Dojo, ExtJS, YUI, GWT, Wicket etc.

Even though we have plenty of options to choose the right framework for our application and got most of the required functionality out of it, we still need to write some code for the following irrespective of what framework we are using.

1. Configuration Management
2. XML Marshalling/Unmarshalling
3. Converting JSON to Java and Java to JSON
4. Emailing support

The good news is even for the above mentioned tasks also we have plenty of options.
I just wanted to put down what are the options we have for the above things. It could be helpful for many if not aware of them.

1. Configuration Management:
I remember how many times i have written(atleast copy pasted) code to load a properties file and provide some convenient methods like getString(), getInt() etc methods. I wondered after knowing that there are some tools to automate this process. The following are the ones i found so far:
2. XML Marshalling/Unmarshalling:
    a) XStream
    b) Castor
    c) JAXB  http://www.vogella.de/articles/JAXB/article.html
3. Converting JSON to Java and Java to JSON:
    a) Jackson JSON Processor

4. Emailing support:
    a) Spring Email support
    b) Commons-Email 

 Instead of reinventing the wheel, we can use the above tools which are well tested and easy to use.


From : http://sivalabs.blogspot.com/2011/01/infrastructure-glue-to-java-apps.html

Published at DZone with permission of Sivaprasadreddy Katamreddy, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)