Struts Kick Start 134
Struts Kick Start | |
author | James Turner and Kevin Bedell |
pages | 481 (29 page index) |
publisher | Sams |
rating | 9 |
reviewer | Simon P. Chappell |
ISBN | 0672324725 |
summary | You need this book |
What is Struts?
Struts is a framework for developing web applications. It is a distilation of the current set of known best practices into a working code set that can be extended to meet almost any web application requirements. It part of the Jakarta Project at the Apache Software Foundation.
What do I know about Struts?
I have been developing web applications, using Java, for four years and using struts for over a year, and am a regular participant on the Struts mailing list. I was also a technical reviewer for one of the other Struts Books released this fall and was recently invited to speak at the University of Wisconsin, Eau Claire on the use of Struts.
What's good about this book?
There are many excellent things that I could point to. I particularly like the obvious depth of research that accompanies this book. There is a very interesting history of the development of the MVC design pattern and they even name the inventor. Do you know who invented MVC? If you want to know, buy the book! The chapters cover everything that you will need to know, in the order you are most likely to need to know it. There's even a chapter explaining the "struts-config.xml" file's DTD! (You may want to skip that on the first few readings :-)There is good coverage of the Struts taglibs. I see a lot of questions about these on the mailing lists, so this information is very timely and it looks very well explained.
I like the coverage of other open source tools that work well with Struts. This is an important point because Struts does not do everything for you (by design), so there will be areas that will benefit from other tools. I'm looking forward to trying out some of their recommendations and easing my own Struts development lifecycles.
What's not so good?
Just one niggle, and it's more of a programming style issue, but in their example code they have references to their business objects. They explain that it is important to separate out business logic from action logic, which it is, but then proceed to use their business object within the action.Now, I realise that example code is not the same thing as robust, production-ready code, but when people are first learning a language or framework, they tend to copy exactly what they see in the book they are learning from. Even though example code should be light on error checking, it should be heavy on correctness and good style.
Should you rush out and buy it?
If you are about to use Struts on a project, are new to Struts and need dead tree documentation for those RTFM moments or are evaluating Struts for future projects, then you absolutely need this book.If you are an intermediate Struts user, then this book would still be very useful to you and I can certainly recommend it.
If you are an experienced Struts user, then you've almost certainly exchanged emails with James or Kevin, on the Struts mailing list, so you can make your own mind up!
Table of Contents
- Struts in Context
- The Model-View-Controller Design Pattern
- Hello World!
- HTTP Protocol
- JSP, Taglibs and JSTL
- The Sample Application
- View Components
- The Controller
- Model Components
- The struts-config.xml File
- How the Struts Tag Libraries Work
- Struts HTML Tags
- Struts Bean Tags
- Struts Logic Tags
- The Nested and Template Struts Tag Libraries
- The Struts Tiles Tag Library
- DynaForms and the Validator
- Using Struts with Enterprise Java Beans
- Using Struts with Web Services
- Building, Deploying and Testing Struts Applications
You can purchase Struts Kick Start from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Re:Struts? (Score:3, Interesting)
Not sure if this is a troll, or intended to be funny . . . but it works on both levels I suppose.
Anyhow, I've been using Struts for about a month refactoring a largish internal Oracle PL/SQL web app, and the MVC separation that's enforced by the Struts framework is really just what the doctor ordered. I'm getting similar functionality in roughly 20% of the comparable lines of code; and this is early enough in the project to where code reuse hasn't even come into play much. I'd imagine it'll end up at about 15% - i.e., 150K LOC using struts as opposed to about a million LOC using PL/SQL.
I know Lines of Code isn't necessarily a good measure of just about anything - but the real benefit is maintainability and ease of expansion (which is what brought on this refactoring to begin with).
Struts is really worth a long hard look - gets you away from using the technologies above and into a real enterprise-class web application structure.
What the big deal with Struts... (Score:1, Interesting)
Strust is just an implementation of what has already been developed by several companies - I will use Apple as an example. The same sort of thing is done with WebObjects in that the HTML from end and back end Java (or Obj-C) is linked with the need to create any real glue to connect them - it just sort of does it for you - with a nice IDE I might add.
WebObjects (like Struts) allows a developer to connect front end HTML to a server and pass data back and forth so that it's easier to deal with on the server...
Okay so why the rant? Well do you really hear about WebObjects being used all that much, NO! The reason (outside of the fact that when it was a NeXT product it use to cost a forture) it that the learning curve is wicked steep. That is where I see Strust going, it's a great technology, can do all sorts of cool stuff, will ease development but requires some time to get ones head around how it works.
I have seen more than a few projects that claim they use Strust when in fact they use maybe 5% of Strust and still need to use code to glue the front and middle tiers together. It's a real shame that we do not have really nice editor integration - ya ya, I know a few editors have the integration but face it folks, they all suck.
What we need is one of the big guns to step up to the plate and really integrate (and support) struts integration *wink wink* Borland...
Just my
What's not so good? (Score:3, Interesting)
Hm. I'm not quite sure I follow you here. I haven't read the book, only your review, and I'm a bit puzzled by your statement regarding business objects in actions.
Is it so that the example code for the actions contain business logic directly, or do they use business objects without wrapping them in controllers (like a session bean)
If they're using session beans or controllers in the actions, I can perfectly understand that. You have to use the business logic somewhere.
On my current project, we have a (yuck) flash-client (using macromedia's Flash Remoting MX, btw. nice thing, saves a lot of time usually spent on devicing your own xml-based protocol to communicate with the flash client) . The flash client accesses a standard java class/bean. This bean contains code to massage the output from a session bean to simple data structures more suitable for a flash client (and programmer. Ok, low blow.
The session bean acts as an facade to all the functionality required by/provided to the client (authentication, fetching and updating data etc.) The system has about 10 session beans and quite a few entities.
We've used this approach before, and when we had to add some new types of clients, we only have to add a bean convert to/from client requests and the controller (session bean).
(At first, we only developed a Flash client. Later, we added a SMS client and a web client.)
Struts ported to PHP (Score:2, Interesting)
Re:Show the full respect of Struts... (Score:2, Interesting)