Related products:
Professional Java Development with the Spring Framework
Pro Spring
Agile Java Development with Spring, Hibernate and Eclipse (Developer's Library)
Ajax in Action
Spring in Action (In Action series)
|
Java
Expert Spring MVC and Web Flow (Expert)
Format: Paperback
Author: Seth Ladd
ReleaseDate: 21 February, 2006
Publisher: Apress
Rating:
Spring MVC In-depth && Spring Web Flow Introduction
Out of them, frameworks like Struts, Webwork and Maverick are deemed as request-driven frameworks, where as JSF and Tapestry are deemed as component-driven frameworks. What is this book about?
Today, an abundance of MVC frameworks - each with its own pros and cons - plague a web-developers decision to choose one. Request-Driven broadly means, that the framework does not hide the HTTP-ness of the web world, but provides absractions that can simplify your job to handle them. Component-Driven means, that the web-framework seeks to hide the HTTP-ness, and provides the developer with an abstraction equivalent to Swing programming. Both types of frameworks have their own advantages and disadvantages. Spring MVC falls into the request-driven web frameworks category.
In my career, i have worked with many web frameworks. Out of all of them, i prefer Spring MVC for the following reasons
1. It has access to the full power of the Spring IoC and AOP container.
2. It is very well architected and brings true seperation of model, view and controller better than any other framework out there.
3. It is highly customizable.
4. It is interface driven, and doesnt force you to extend any framework classes.
5. It is easily testable - both unit and integration tests.
6. It helps apply good OO principles to the web-tier.
7. It provides easy-to-use template implementations of basic workflows.
8. It provides support for various view types(JSP, Velocity, Freemarker, etc) and completely decouples this support from other parts of the MVC.
9. It provides an exhaustive set of interface based hooks that one can customize or freshly implement for their own purposes.
10. And many more. . .
The above list is by no means exhaustive. So, i sincerely suggest to consider this framework if you are researching on an MVC implementation for your next project.
This book is all about Spring MVC and a sub-project called Spring Web Flow (SWF). Now, that you know what Spring MVC is, and where it fits into the plethora of available web-frameworks, you might be wondering what SWF is. Is it yet another web-framework that Spring supports? Is it a seperate implementation of Spring MVC? Is it something else? These kind of questions might come up, and i had all these questions in mind when spring announced SWF.
Anyways, SWF attacks a different problem. It is a seperate and self-contained framework, where you can define flows. Each flow is potentially a conversation between the user and the server over multiple pages and requests. The flows can be defined declaratively, and integrated with the MVC framework of your choice for execution. Spring MVC, Struts, JSF, Portlet MVC are supported out-of-the-box, but it is easy to implement an integration for your favorite framework.
How this book does it?
There are quite a few spring framework books around, that covers the entire framework. Sadly, none of those books gives Spring MVC enough importance and coverage is decent at best. Those books are geared towards covering the IoC and AOP features in-depth and finally when the book reaches the MVC section, they just breeze past it, not giving us enough practical ways to use it.
That is where this book comes in. This book takes from where other spring books leave and covers the entire Spring MVC framework in-depth. The author's writing skill is fabulous. You will be turning pages, before you even know. Typically, when you learn a new topic, you dont want to get into the details out-right. You want a complete mental picture first, then dive into details. That is exactly what the author does. He takes a topic and explains the overall picture in a couple of paragraphs. This first gives you the idea and scope of that topic. Then the author revisits the topic to explain it in depth with examples. I liked this approach very much. Trust me, I have read many spring books before, this one covering Spring MVC the best.
That said, this book is not for developers who are not familiar with spring. You should know Spring's IoC container, AOP, and other basic features before you can make sense out of this book. The author devotes one full chapter to provide a brief introduction to spring. That may be enough, but to be really confident, it is better if you first learn spring. I would suggest Pro Spring for that. Read my "Pro Spring" review for more information.
Simply an excellent read
This book gives the Spring community a fix that'll keep us satisfied for the time being. While many of the top notch Spring books offer reasonably thorough coverage of the Spring MVC framework along with other core Spring modules, there's not much printed material on Spring Web Flow.
The authors do a good job at introducing in just a dozen pages enough fundamental concepts that a Java web developer needs in order to be ready for the rest of the book. In other words, no long-winded descriptions of the XML configuration files needed for configuring Spring, no detailed descriptions of how to wrap your beans into proxies, etc. Instead, you're taken straight down to business.
The core of the book starts out by first describing the Spring MVC architecture, including the role of controllers and views. Followed by the description of the architecture, the authors take the reader to a rollercoaster ride through the Spring MVC processing pipeline, including how to customize URL mappings, for example.
The chapter on controller components covers everything I can think of and the chapter on views and different view types does a great job at showing how to configure alternative view resolvers, how to internationalize your application's message resources, and how to render alternative content types such as PDF and Excel sheets in addition to covering the mainstream templating languages used for generating HTML, including JSP and JSTL as well as open source frameworks such as Velocity and FreeMarker.
An extra bonus point goes to the authors for including a section on testing Spring applications, even though the focus is mostly on unit testing controllers which is kind of a low-hanging fruit anyway. On the other hand, while topics such as validation and internationalization are discussed, the equally essential aspects of authentication and authorization are not given any attention.
The last two chapters, approximately 60 pages, are devoted to the brand new Spring Web Flow framework. I was glad to see the authors' pragmatic approach to stating the sweet spot for using Web Flow rather than proposing it as the "golden hammer" as they say. The explanation of the Web Flow concepts as well as the examples the authors use for guiding the reader through them are easy to understand.
As a summary, I thoroughly enjoyed reading this book and got a lot out of it. The only reason I considered not giving this book the absolute best rating possible is that there's a couple of security-related topics missing that I consider essential for any book dedicated to developing web applications.
Great framework, good book
We used this book to get up speed quickly (2 weeks) and implement a application using Spring Web Flow within a month of learning the basics. Spring MVC and Web Flow are excellent contemporary web frameworks. My only gripe is although Web Flow is very new, I wish there were more coverage. Granted you can pour through the javadoc as usual and guess at some things, I would have preferred a larger book that covers more. All in all, for a first book containing Spring Web Flow information it was very good.
|
|