Tapestry in Action

Howard M. Lewis Ship

2004 | 580 pages
ISBN: 1932394117

$44.95 Softbound print + PDF ebook  
$35.99 PDF ebook  

RESOURCES

Look Inside Resources Downloads

DESCRIPTION


Get a first hand look at Tapestry in action by trying the Hello World example provided by Howard Lewis Ship, creator of Tapestry and author of the book.

Many web development frustrations can be traced back to the underlying stateless HTTP protocol. Tapestry represents state and behavior as standard Java objects, methods and properties. That means state management and multithreading are handled by the framework, leaving you with just your application's business logic. Tapestry does more, you do less.

Tapestry in Action is the definitive guide to the Tapestry approach: creating full-featured web apps by connecting framework components to economical amounts of application code. Many simple examples show you how to tackle common tasks such as form validation, application localization, client-side scripting, and synchronization between browser and app server. Later chapters discuss more advanced topics including creation of new components and integration with J2EE.

If you want to create great web applications using Tapestry and know Java (plus plain-vanilla HTML and a little XML), this book is for you.

What's Inside

WHAT THE EXPERTS SAY ABOUT THIS BOOK...

"... masterfully written, making this elegant framework accessible to all Java web developers."
-- Erik Hatcher, co-author of Java Development with Ant

"Tapestry In Action absolutely rocks!"
-- Bill Lear, Wayport Inc./DejaNews

"Tapestry is "the way" ...and there is no better authority on the subject than Howard Lewis Ship."
-- Geoff Longman, Intelligent Works, developer of Spindle for Eclipse

"I found this book just right--for newcomers and experienced Tapestry developers alike."
-- Richard Lewis-Shell, Techcon

"Keep your html code-free--write OO webpages the Tapestry way!"
-- Joel Trunick, SmartPrice.com

ABOUT THE AUTHOR...

A professional software developer with fifteen years of experience and a member of the Apache Software Foundation, Howard Lewis Ship is the creator and the principal architect of Tapestry.

Foreword

My involvement with Tapestry began in the autumn of 2001. I read about the framework in an article in ONJava magazine. At the same time, our company was poised to begin several new web projects, and we were looking for a way to avoid the problems inherent in building complex web pages and forms with the standard tools. We analyzed a large number of frameworks, but Tapestry immediately attracted our attention, with its unique development method and its helpful community.

The first glance was not misleading—Tapestry proved to be a powerful and helpful instrument in practice as well. The component structure was not simply an add-on but was entrenched in the philosophy of the framework. We also discovered that Tapestry offered a number of other powerful features that proved to be critical in our work. For example, it allowed a clean separation between Java and HTML, and made it possible for the design work on the application to continue well after the code had been completed—and it could be performed by designers who never had to know anything about Tapestry. It provided internationalization capabilities well beyond simply replacing text with its translation. The framework was designed with EJBs and clustering in mind, and integrated with them effortlessly.

Today our company has libraries containing hundreds of Tapestry components. Some of these are simple, such as a Login component that manages authentication using HTTP cookies. Others are far more complex, constructed from smaller components and full of intricate JavaScript, such as a tool for dynamically defining web forms. All of these components can simply be taken off the shelf and plugged into our latest application with ease. We do not have to worry how the various components will work together—we know that they will do so by design.

During the two years we have worked with Tapestry, its development has not stood still. While the earlier versions of the framework concentrated on delivering power, version 3.0 (described in this book) concentrates on both delivering maximum ease of use for programmers and enhancing their productivity. It lowers the entry requirements, decreases the amount of developer effort needed, and makes the framework as easy to use as a scripting language for simple applications. The result is that you can achieve the same results as before but with much less coding.

The majority of these improvements have occurred and moved forward due to feedback and ideas from Tapestry users and contributors. The active community surrounding the framework helps it remain focused on resolving the problems developers encounter in the real world. A major commendation for encouraging and integrating the contributions must also go to Howard Lewis Ship, the author of this book. As the creator and original designer of Tapestry, he has made a remarkable effort to listen to users, understand their needs, and address their requirements. The other Tapestry contributors have followed his lead and have extended the framework to provide support for a variety of new functionality areas. The community has also been instrumental in the process that made Tapestry a part of the Apache Jakarta family. With this step, it became a companion project of other popular projects, including Struts, Tomcat, and log4J. All of these factors ensure that Tapestry will persist in its evolution and will continue to improve the ways in which it makes the life of web developers easier and more productive.

This book will allow you to delve into a different, better world of web development than the one you have known. It will show you an innovative approach for creating and organizing your applications, enable you to develop more robust and scalable code, and make previously difficult tasks much simpler. After you get to know Tapestry, you will start looking at web development in a very different way. Enjoy!

Theodore Tonchev

“Mindbridge”

Technical Director, Rushmore Digital

Hello World Example

If you're anxious to see a little bit about Tapestry without having to go to the trouble of downloading Tapestry and the Tapestry in Action source code, you're in luck! We've created a pre-built "Hello World" Tapestry application that is ready to download and drop directly into your servlet container's deploy directory. This file, helloworld.war, contains all the necessary Tapestry libraries and dependencies, as well as the source code and compiled Java classes.

lewisship_src_helloworld.war

Note: you may need to right click and select "Save link as..." or the equivalent in your browser to force it to save the file rather than load it into the browser window.

WHAT REVIEWERS ARE SAYING

"The copy we have in the office was passed back and forth as we all grappled our way up the learning curve --- and it is still covered in post-it notes. ...The book does an excellent job of providing straightforward examples and using language that is accessible to novices, then gradually working up to more advanced techniques...The last section takes you through designing and implementing a full Tapestry application, bringing everything together...definitely worth the investment to have a copy for reference."
-- Dr. Dobb's Journal

"Does indeed live up to its subtitle: 'the definitive guide to Web application development with Tapestry. There are two reasons for this. First, the book's author is also the developer of Tapestry. Second, and unexpectedly, he is a good writer: his writing is clear and amusing, and he is not afraid to walk the reader through the tricky bits. ...this book gives you what you need to understand the components, while you try them out for yourself."
-- Computing Reviews

"Highly recommended.
I rate it as highly recommended, not because there is little competion, neither because the author also happens to be the main designer and developer, but because it is well written, attractively presented and very practical in its use of example projects and code fragments."
-- C Vu, the Journal of the ACCU

"From the creation of new components to integration J2EE, Tapestry in Action covers everything and does so with a thoroughly "user friendly" text enhanced with simple examples. No Java reference collection can be considered complete or comprehensive without the inclusion of Howard Ship's Tapestry in Action."
-- Internet BookWatch

"If you're going to be working with Tapestry then there is no doubt that this IS the book you want . . . it definitely will guide you along that journey . . ."
-- TheServerSide.com

"A great book about how to change the way you develop web applications. Tapestry in Action is your exit route from the ugly world of stateless HTTP pages and spaghetti HTML intertwingled with Java code and various macros. The steep learning curve is a small price to pay for a two or three-fold improvement in overall productivity. This book should help you get started really quickly."
-- JavaLobby.org reviewer Adrian Spinei

"I have enjoyed reading Tapestry in Action ...Howard has done a really nice job of providing a server-side page & component model that more closely corresponds to my way of hinking about user interaction than other frameworks."
-- Rick Ross, JavaLobby.org

"If you want to learn all about Tapestry, this is the right book for you. You will learn how to develop simple and complex web applications, how to build reusable components, but you will also understand the internals of the framework. All in a book.

Conversely, if your goal is only to have an overview of the framework, be prepared to face an high-detailed and complex book, and dive through the secrets and the difficulties of writing a modern MVC framework. Definitely, it is not a "for dummies" book."
-- Java User Group Milano (Italy)

"Tapestry is a powerful presentation framework for web applications using components, but the project has been lacking current, extensive documentation. This new book by the creator of Tapestry has met the challenge. It is composed three major parts: getting started, developing Tapestry components, and putting it all together into a J2EE application complete with EJB. Fortunately, for the web app novice, Howard starts at the beginning. The prerequisites are fairly low. A moderate level of knowledge of Java and HTML are basically all that is required to follow the coding examples. Also, UML sequence diagrams are used to illustrate the flow of the Tapestry framework as described in the text.

One of the "knocks" against Tapestry has been the stiff learning curve. This book should help reader overcome this hurdle. Insight into the framework is built in a logical, incremental fashion. Because of this structure, it is best to read the book front to back unless you already are knowledgeable about Tapestry. The middle section will also serve as a good reference for building custom Tapestry components.

This is a great book. It is well written, relatively easy to follow, and about an interesting, timely product. If you are planning a J2EE project, this book and the framework deserve a look. Thankfully, Howard does not waste pages in an anti-Struts diatribe, but rather focuses on how Tapestry improves web development. Your challenge is how to fit that explanation into your boss's attention span."
-- Columbia Java Users Group