Conclusion on Spring Roo
With the previous sample, you got a little taste of how Roo can help provide a rapid development
environment. The Roo project is still evolving quickly, and many add-ons are being developed.
The Roo project has great potential, so it is worth keeping an eye on its development. Even though
you may find it not good enough to have it generate your JEE application for production use, it is still
very useful for generating application prototypes during the initial design phase. Also, the folder
structure and classes that Roo generates are based on industry best practices, and the code style, context
configuration, and so on, are all based on the SpringSource team's recommendations.
It's also worth taking a look at the application that Roo generates for you and using it as a learning
tool to understand the best practices and coding style for Spring-based applications.
If you are interested in learning more about Spring Roo, please refer to the reference documentation
(http://static.springsource.org/spring-roo/reference/html/index.html) and the book Spring Roo in
Action (Manning, 2012).
Spring Batch and Spring Integration in the Sample
Application
In the SpringBlog application, we will adopt Spring Batch and Spring Integration to implement the job of
importing blog posting entries from an XML file.
The mechanism discussed in this chapter will be used in developing the batch job. First, the XML
file format for blog posting will be defined, together with the corresponding Castor mapping definitions.
Second, Spring Integration's file polling support will be used for scanning the arrival of a file
containing new blog postings. When a new file arrives, the inbound channel adapter will pick up the file,
and then the file message will be output to the file's channel.
The same transformer developed in this chapter will be used to transform the file message into the
job launch request message, and outputting it to the requests channel.
A batch job will be implemented for importing the blog posting entries, which use the same service
layer to perform write processing. JSR-303 validation will be used for item processing too. The service
activator will be used to launch the job.
For details, please refer to Chapter 21.
Summary
In this chapter, we covered several interesting and useful Spring projects that can help us fulfill common
application requirements.
First, we discussed the Spring Batch project and its chunk-based processing architecture and saw it
in action by implementing a contact import job. Then, we demonstrated how Spring Integration can
help perform message-based integration, its support for file-related operations, and how it works with
Spring Batch for job launching.
Finally, we discussed the interesting Spring Roo project for rapid application development and
prototyping. We discussed its innovative command-line support for code generation of various
application layers, flexibility in taking back the control from the generated code, and the add-on
architecture that allows the addition of your preferred tools and libraries.
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home