Newsletter:

(Article) Groovier Spring, Part 1 : Integration basics

Article : Groovier Spring, Part 1 : Integration basics

The Spring Framework provides a solid foundation for Web and enterprise applications. Spring's support for dynamic languages like Groovy adds capabilities that can make your application architecture more flexible and dynamic. In Part 1 of this two-part series, you'll learn the basics of integrating Groovy into Spring applications.

Spring 2.0 introduced support for integrating dynamic languages into Spring-based applications. Out of the box, Spring supports Groovy, JRuby, and BeanShell. The portions of your application that you write in Groovy, JRuby, or any other supported language (including, of course, the Java™ language) will integrate seamlessly into your Spring application. The rest of your application's code doesn't need to know or care about the implementation language of individual Spring beans.

Spring's support for dynamic languages means your applications can gain flexibility and dynamic behavior with no strings attached; you can have your cake and eat it too. In Part 1 of this series, you'll see how to use Spring and Groovy together, and how that powerful combination can add interesting capabilities to your application. For example, you might need to make frequent changes to small chunks of business logic, to the text contained in e-mail messages your application sends out, or to the formatting and layout of PDFs that your application generates. Traditional application architectures might require a complete redeployment of the application in order to make these kinds of changes. Spring's support for Groovy lets you make such changes to a deployed application and have them take effect immediately. I'll discuss the benefits this capability can bring to your application and the issues that might arise. The complete source code (see Download) for all of the article's examples is available for download.

Spring's dynamic language support
Dynamic-language support has changed Spring from a Java-centric application framework to a JVM-centric application framework. Now Spring doesn't just make Java development easier. It also makes development for the JVM easier by allowing code written in both static and dynamic languages to plug easily into the layered architectural approach Spring supports and facilitates. If you are already familiar with Spring, then you'll feel right at home: you can take advantage of all the features Spring already provides — inversion of control (IoC) and dependency injection, aspect-oriented programming (AOP), declarative transaction demarcation, Web and data-access framework integrations, remoting, and more — while using a flexible, dynamic language like Groovy...

[Read More..]

Courtesy:- Ibm.com