Tapestry 5, Building Web Applications- Review

by Amit


This review was published on request of Packt Publishing who provided me with a review copy. I am not affiliated to them in any way.

Tapestry 5 Building Web Applications is an introduction to Java Web Application development using the Apache Tapestry Framework.

The book assumes development experience using Java, with no or little prior exposure to Java Web development. For readers who are well versed with other Java Web Frameworks, this book will serve as a nice, gentle introduction to Tapestry.

The entire text of the book is covered in 8 different chapters with a natural flow between the chapters, and will be best benefited by reading from the beginning. This gives a “text-book”, rather than a reference flavor to the book.

The author takes a hands-on approach to present the concepts. New concepts are well explained by code examples. Readers are advised to hand code the examples in the book, rather than download the code examples.

Besides Tapestry, software tools you will come across in this book are “db4o”, “Maven”, “NetBeans IDE” and “Eclipse IDE”.

In the next sections, chapter wise summary of the book follows.

Chapter 1: Introduction to Tapestry

This chapter begins with an introduction to the need for web frameworks, following it up with a gentle introduction to the Tapestry web framework. It briefly touches on the features of Tapestry 5, most of which are dealth with in later chapters.

For developers who have used earlier versions of Tapestry, the journey from Tapestry 3 to 5 is also discussed.

Chapter 2: Creating Your Working Environment

As the chapter title suggests, here the author shows how you can set up your working environment to begin Tapestry development on Linux, MS Windows or Max OSX. Though explicit instructions for Linux are not given, the Mac OSX instructions can be easily followed there.

The approach followed in this book is to first create a default Tapestry application using Maven, and then either use NetBeans IDE or Eclipse IDE to carry on the compilation, build and deployment of the application.

A technical discrepancy was discovered in this chapter. According to the author, any changes in the template file (‘start.tml’) would not be reflected if the accompanying class file (‘start.java’) is not changed. This is not found to be true when the steps were reproduced on NetBeans IDE 6.0 or Eclipse 3.0 (‘Europa’).

The major steps are correctly mentioned in a clinical manner. However, the reader who is not experienced with Maven might feel that some necessary details have been given the miss. Some desirable additions to this chapter would be brief descriptions of:

  1. How Maven creates the whole Tapestry project structure?
  2. What are files that it downloads and why?
  3. References to more information about Maven

Chapter 3: The Foundations of Tapestry

As a natural follow-up to the previous chapter, the basics of Tapestry Development is introduced here. Concepts such as Plain Old Java Object(POJO), Components, Event Handling, Pooling of Tapestry pages, Application State Object (ASO) are introduced to the reader in an easy fashion.

After reading this chapter, the reader can start building simple multi-purpose Tapestry Web Applications.

Chapter 4: Simple Components

This chapter introduces simple Tapestry components such as TextField, Password Field, PageLink, Loop and Select. Instead of giving a demo working of each component, the author adopts a practical approach by showing how each component fits in with the others in a near real-life Web Application- ‘Celebrity Collector Project’. This project is enhanced in each chapter by integrating the new concepts introduced there.

This chapter also introduces an important concept- that of “Message Catalogs”.

Chapter 5: Advanced Components

More useful components such as ‘Grid’, ‘BeanEditForm’, ‘DateField’, ‘FCKEditorComponent’ are introduced here. This chapter also demonstrates the usage of JavaScript components such as ‘DateField’ without writing a single line of JavaScript.

Chapter 6: User Input Validation

The reader is introduced to input validation concepts in this chapter. Providing custom error messages is another concept discussed here.

Chapter 7: Internationalization and Localization

The topic of Internationalization and Localization is touched in this chapter.

At the end of this chapter, the reader will have a pretty “Celebrity Collector” Web Application with Internationalization support.

Chapter 8: Creating Custom Components

After having introduced simple and advanced Tapestry components, the author demonstrates to the reader the creation of custom components. Custom Components are useful in cases, such as when the developer needs to duplicate a single functionality on all or multiple pages of a Web Application.

Appendices

The book is accompanied by two appendices- one “The Basics of Java for the Web”- describes the general concepts of Java Web Application. Readers new to Java Web Application development are advised to consult this appendix to learn some basic Java Web Application concepts.

The second appendix, “Creating a Real Data Source with db4o”, introduces the object databased named “db4o” which will give a nice insight into enhancing the mock Web Application by doing away with the Java class way of storing and retrieving data.

End-Notes

I took my first step in the Apache Tapestry using this book, and I must admit that I now know much about it after reading the book. This is an important observation, since this means that the book has successfully introduced Java to its target audience.

No work can of course be perfect. Here are some suggestions to improve the book:

  1. The chapter wise source code downloaded from the book’s website was often found inconsistent with that written in the text and some amount of tweaking was required to get the correct functioning.
  2. The source code would be best distributed as NetBeans and Eclipse projects, to enable auto-inclusion of the libraries and enable to reader to directly start working on the projects.
  3. An appendix each for working with Maven, Eclipse and NetBeans will make the novice readers more comfortable working with these tools.

If Apache Tapestry interests you, and you know nothing about it, add this book to your book repository.

Advertisements