Hi guys,
I recently wrote a rather lengthy review on this book for the AutinJUG. Here it is. Enjoy!
-----------
Book Review: JSP Tag Libraries
April, 2002
Reviewed by Michael J. Yuan for AustinJUG
http://pancake.as.utexas.edu/juntao/ OVERALL:
Custom tag is one of the most important elements in JavaServer Pages (JSP) technology. Working with other server side
Java components, such as JavaBeans, EJBs and JDBC, properly designed custom tag libraries allow developers to encapsulate and reuse code. Custom tags create a tag-based content authoring environment and allow web authors to write highly dynamic web applications in HTML style without learning the Java programming language. So, architects, developers and content authors can all benefit from studying JSP custom tags.
Manning's book "JSP Tag Libraries" by Gal Shachor, Adam Chace and Magnus Rydin (ISBN 1-930110-09-X) is an excellent JSP custom tag text suited for both new and seasoned developers. This book covers JSP specifications 1.1 and 1.2.
One of the main strengths of this book is that it does not merely repeat API documentations. The authors put a lot of effort to show the readers the big picture, the
philosophy behind JSP custom tags and how to apply them in real world applications. This book talks about "why" as well as "how".
After studying this book, the reader should be able to understand:
* What JSP custom tags are and why we need them;
* How custom tags work;
* How to use tags to perform common and advanced tasks;
* Steps to develop and deploy tag applications;
* Basic design
patterns for tag applications;
The book is very well organized and well written. It is full of excellent code examples. Those examples put the techniques into context. The readers can learn effectively by playing with the examples. As added bonuses, the code examples can be easily adopted for real world applications. In section "Case Studies", the authors discuss two complete multi-tier E-commerce and M-commerce applications. They offer not only code examples on applying practical techniques but also insights and templates on how to design good JSP applications.
All the code examples in the book are annotated with in-depth explaining text. That truly helps readers to understand not only what the code is doing but also what the authors intended to do.
However, there are still things I wish the authors could improve in the next version:
1. The authors had excellent discussions on how to implement conditional tags, iteration tags and database access tags. But they did not mention similar tag libraries under development by the Jakarta Taglib project. I would really like to hear about their insights on the designs of Jakarta tag libraries and many similar libraries developed by commercial companies.
2. In the "Case Studies" part, it is quite easy to add a parallel WAP store front to the JDBC-driven WebStore through another set of custom tags. That would really drive home the power of separating business logic from presentation logic and highlight the flexibility of a JSP custom tag based solution. I wish the authors had done that.
Overall, I think this is an excellent book and would like to HIGHLY RECOMMEND it to anyone working with JavaServer Pages technology.
SECTION REVIEW:
Part I: The Language of Tags.
The book starts off by introducing the big picture of tag-based dynamic Java server programming. The authors make the effort to explain WHY the tag-based approach is good for both developers and content authors. Even for experienced JSP developer, I recommend this first chapter since it reminds us why we would choose this technology and how it affects our choice of designs in real world development. The points made in the first chapter are well echoed throughout the rest of this book.
Then, the authors go on to describe basic Java and JSP syntax and give a quick example on how to develop and deploy a working custom tag. For a new developer, in less than an hour into the book, you already have a working custom tag deployed on your server to play with! Following that simple example, the book describes the custom tag APIs, life cycles and TLD files.
After reading Part I, the readers should understand how the custom tags work. But there are still a lot of finer points in the APIs that need more explanation. So, read on ...
Part II: Basic Techniques.
The book continues to discuss the tasks custom tags normally perform, such as handling attributes and tag bodies, writing tag output to the resultant page, logging and exception handlings. The authors do not talk about those techniques in dry terms. Instead, they give two very useful examples to illustrate the techniques: One is an email tag and the other is an improved JavaBean tag. The example of the JavaBean tag also helps the readers to understand how standard bean tags work and therefore how to use them more correctly and efficiently.
Part III: Advanced Techniques.
This part is a natural extension from Part II. The authors give more examples on how to use custom tags to perform sophisticated tasks. In this section, the book has four examples. Two of them are presentation flow control tag examples: conditional tags and iteration tags; The other two are backend access tags: JDBC tag and EJB access tags.
Part IV: Case Studies
In this part, the authors give complete examples of a JDBC-driven WebStore and an EJB-driven WAPStore. Through those two cases, the authors explain the design philosophy, architecture and approaches. They also give full annotated source code for implementations. After studying those two cases, the readers should be able to design and implement database or EJB driven multi-tier E-commerce or M-commerce applications on their own. The existing source code given in the book can be easily customized and applied to real world applications.
These two case studies really add value to the book and make it a must have for developers and architects alike.
Part V: Design
There is only one chapter in this section: tips and tricks. It discusses a number of misc designing and implementation issues, suggests best practices and reminds readers about the pitfalls. I recommend this section for all developers.