Apache
  Home arrow Apache arrow Page 4 - Apache Tapestry 4 Tutorial
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
APACHE

Apache Tapestry 4 Tutorial
By: Alexander Kolesnikov
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 113
    2007-04-03

    Table of Contents:
  • Apache Tapestry 4 Tutorial
  • JavaServer Pages came to the rescue
  • The Holy Trinity of software development
  • Why Tapestry?
  • Tapestry and prejudices

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    PCmover - $15 Off with Coupon Code CJPH7Q

    Apache Tapestry 4 Tutorial - Why Tapestry?
    (Page 4 of 5 )

    The First Reason: Tapestry is easier to learn than any other contemporary framework. I hope you will appreciate this following my tutorials. This is because the higher level architecture of Tapestry is natural and clear. Every page of a Tapestry application is a Java class. It can have its state - properties - and its behavior - methods. Pages can handle different events as they have event listeners for them.

    This sounds very familiar to everyone who has done object-oriented programming, regardless of programming language. This is why Tapestry should be easy to adopt by a wide range of programmers coming from different platforms. In fact, my colleagues with an ASP.NET background find Tapestry easy to understand - but not Struts.

    The Second Reason: Tapestry has a unique display technology. For example, with JSP, when you take an HTML mock up and convert it to a dynamic page, this process is irreversible. Something, which was only recently a design masterpiece, becomes, at least from the designer's point of view, a bunch of incomprehensible tags. And if there is any significant change in design, it might be simpler to throw away the existing JSP page and to create it anew.

    Let's consider an example. Here is how a designer would create a simple text box:

    <input type="text" class="someStyle"/>

    To make this text box a dynamic part of his application, a Struts developer would write something like this:

    <html:text property="userName" styleClass="someStyle"/>

    And here is the same work done by a Tapestry developer:

    <input type="text" class="someStyle" jwcid="userName"/>

    The difference is obvious: the Tapestry template remains a valid HTML page and  can be easily previewed by any standard tool, or any Web browser. To convert an HTML element into a Tapestry component, all we need to do is insert a special jwcid (Java Web Component ID) attribute. Any piece of software that doesn't know what this attribute means will simply ignore it.

    One of the benefits of this is that a Tapestry template remains perfectly editable by any design tool, without a danger of breaking any Tapestry instrumentation. You will appreciate this when, after creating a few dozen pages for the first iteration of your project, you receive feedback from your client saying that design and layout should be changed in, say, 36 places. With Struts, that would be a disaster. With Tapestry, this is no problem at all.

    Also, if you start your project from a series of HTML mock ups created by a designer, it takes very little effort to convert mock ups into Tapestry templates.

    All in all, the Tapestry's unique display technology makes Java Web development much more efficient and solves the problem with which JSP technology has been struggling for years.

    The Third Reason: Tapestry custom components are very easy to create and use. Again, Tapestry is unique in this respect between contemporary component-based frameworks. For example, in JavaServer Faces to create a component you need to know intimately the inner (quite complicated) structure of the framework. This is a task for an advanced developer, not a beginner.

    In Tapestry, we shall start creating custom components in one of the first parts of this tutorial and you will see how easy it is. As soon as you see a repeating piece of the interface or functionality, you just put it into a component and then drop that component onto any page where it is needed. If you think that your components will be useful in a different project, or maybe you want to make a present for your friend, you can easily pack them into a library and distribute as widely as you wish.

    This is especially important because, as perhaps is true with every framework, Tapestry has some obvious simple components missing. But that is no problem at all - create them yourself and share them with the others. This is one of the things we are going to do later in this tutorial.

    The Fourth Reason: Tapestry has in it just everything one would expect from an advanced contemporary framework. A superb, easy to use user input validation, internationalization, incomparable error reporting, version 4.1 has its own AJAX components, version 5 goes even further in terms of efficiency and beauty of design... What else do you want?

    So, if Tapestry is really so good, why it is not as popular as it deserves to be? This is actually a surprise for me. After spending so much effort to convince my manager that Tapestry is the right tool for our next project I feel like there is some kind of psychological barrier surrounding Tapestry. My opinion is that there is a set of prejudices that hinders Tapestry's advancement. Two of them are listed in the next section. 

    More Apache Articles
    More By Alexander Kolesnikov


       · Dear readers,Welcome to the world of Apache Tapestry. I am quite passionate...
       · Excellent article, Alexander. Difficult for me in parts, but at the leading edge....
       · But what exactly do you find difficult? I wonder if it can be written in such a way...
       · Great article pal:)I just went and bought that book under your advice and it...
       · I am referencing my Tapestry dissertation somewhere in the article. Normally, people...
       · Thanks, Rob,Just note that Kent Tong explains how to deal with "bare-bones"...
     

       

    APACHE ARTICLES

    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...
    - The Properties of Tapestry Pages




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway