gamelan
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Linked Data Planet Conference & Expo


Developer Jobs

Be a Commerce Partner
Find Software
Dental Insurance
Prepaid Phone Card
Promotional Pens
Corporate Awards
Free Business Cards
Promote Your Website
Imprinted Promotions
GPS Devices
Promotional Gifts
Calling Cards
KVM over IP
Compare Prices
PDA Phones & Cases

 


  Rethinking the Datacenter
Sponsored by HP
Today's datacenters need to increase utilization, get control over power and cooling costs, and align with business objectives. Download this eBook to learn about the challenges facing the data center in a world where digital information is growing at a torrid pace and costs are being held in check. Learn more. »
 
  Putting the Green into IT
Sponsored by HP
Electricity use in data centers is skyrocketing, sending energy bills through the roof, creating environmental concerns and generating negative publicity. "Going Green" means looking to technologies like virtualization, energy-efficient chips and racks, and implementing policies that extend beyond the data center. Learn more. »
 
  Managing the Modern Network
Sponsored by HP
In a global economy where information crosses the globe in an instant, and where Web-based applications power business, it's more important than ever to ensure your network is safe from threats and optimized to deliver the data your business needs. »
 
  Evaluating Software as a Service for Your Business
Sponsored by Webroot
Is Software as a Service just hype, or is something really going on here? See if your company can benefit as SaaS tries to change the face of the enterprise. »
 
  Is Your Disaster Recovery Plan Good Enough?
Sponsored by HP
Preparing for a disaster is more often than not part of the storage planning process, and it is one of the most difficult tasks, since it includes local hardware and software, networking equipment, and a test plan. Learn how to get disaster recovery right. »
 
Related Article -
Weaving the Tapestry Framework
Apache Struts Framework: The Big Picture
Working with the WebWork Framework
Modern Java Frameworks for Web Development
Developer News -
SaaS Tool Offers Custom Database Development    May 9, 2008
Microsoft’s Automated Agent: Can We Talk?    May 7, 2008
Borland Finally Sells CodeGear    May 7, 2008
Red Hat Heads For The JON 2.0    May 7, 2008
Free Tech Newsletter -

Best Practices for Developing a Web Site: Checklists, Tips, Strategies & More. Download Exclusive eBook Now.

Advanced Features of the Tapestry Framework
By Vlad Kofman

Go to page: 1  2  Next  

In the first part of this article, I discussed the main structure of the Tapestry framework, as well as its setup and configuration in an enterprise scale development environment such as JBuilder 2005. In this article, I will further explore the features of the framework and discuss specific components and pre-build modules. A sample application that uses Tapestry is included for your reference as well.

Structure of the Framework

As discussed in the first part of the article, the Tapestry framework tries to hide all of the plumbing associated with coding a Web application by giving developers a solid API set that feels more like a desktop Graphical User Interface (GUI) or a Swing development toolkit. For instance, it is never necessary to write code to directly read HTTP parameters, or directly deal with session, request, response, JSPs, tags, and so forth.

Most modern Web frameworks come with pre-build modules to help with development process, simplify specific functions, or give developers more flexibility. Tapestry is no exception; in fact, it excels in this area. It comes with a cornucopia of pre-built modules that have all of their functionality working "out of the box." I will elaborate on this later. In addition to providing a lot of APIs for the developer, Tapestry provides whole modules that try to do the most common tasks found in the Web application, such as file upload, date/calendar logic, table pagination, field validation, internalization, redirection, and even popup functionality. Among some of the more advanced modules that also come as standard functionality of Tapestry are data trees and charts.

At the time of this writing, Tapestry is at version 4. The class and interface hierarchy are fully developed and the code is stable. Most components also are finalized and production quality. The code for the framework is combined into several logical packages, each corresponding to a specific functionality or feature.

Here is a short list of the most interesting packages provided by the framework. The complete list is available in the references section as Appendix A.

org.apache.tapestry
org.apache.tapestry.components
org.apache.tapestry.contrib.jdbc
org.apache.tapestry.contrib.link
org.apache.tapestry.contrib.popup
org.apache.tapestry.contrib.table.model
org.apache.tapestry.contrib.tree.model
org.apache.tapestry.engine
org.apache.tapestry.event
org.apache.tapestry.form
org.apache.tapestry.html
org.apache.tapestry.listener
org.apache.tapestry.multipart
org.apache.tapestry.valid

The main packages are org.apache.tapestry and org.apache.tapestry.engine. They represent the "brains" of the framework and expose public interfaces, as well as concrete implementation of them for the developers. The IEngine AbstractEngine and BaseEngine interfaces are located there.

The org.apache.tapestry.components package has "Basic, fundamental components used to construct more complex components, or pages," are very powerful objects that allow a lot flexibility. The org.apache.tapestry.contrib.jdbc, org.apache.tapestry.multipart, and org.apache.tapestry.wml are some of the packages that contain a lot of extra useful functionality. I mention them to show just how massive the framework is, and how the creators are trying to cover all possible aspects of the enterprise Web development. The org.apache.tapestry.listener and org.apache.tapestry.event packages have some of the classes that give Tapestry APIs resemblance to the GUI or Swing listener mechanism for the pages (and objects on them). Because all of the logic of the Web interface is hidden in Tapestry, these classes make it very easy to code events and actions based on them.

The org.apache.tapestry.contrib.link and org.apache.tapestry.contrib.popup are helper packages that encapsulate links and popup windows. The org.apache.tapestry.form package encapsulates HTML forms and treats all of the HTML elements of the form as objects, giving developers ability to add listeners or associate state with these elements. The org.apache.tapestry.valid package has some useful validation classes, such as EmailValidator or DateValidator. There is a public interface IValidator, but it was very thoughtful of the Tapestry creators to include a lot of pre-built validator objects. The org.apache.tapestry.html package has components specific to the creation of HTML pages, including sophisticated DHTML JavaScript effects. If you are familiar with the Swing toolkit, you will find some likeness in the package structures, in particular org.apache.tapestry.contrib.table.model and org.apache.tapestry.contrib.tree.model have model classes for the tree and the table components. The GUI classes that use these models are in org.apache.tapestry.contrib.table.components and org.apache.tapestry.contrib.tree.components packages. These components are very robust and have pre–built-in functionality that performs without any extra work; for example, the table has sorting and pagination capabilities.

I recommend that you explore the great API documentation that comes with Tapestry before plunging in and coding some feature. Chances are if the feature is generic, it may available be already.

Framework Components

Because Tapestry encapsulates Web APIs in the form of a component object model, all of the most common Web objects are available as objects to developers. Here is the complete list of some of the components that are available "out of the box" with the Tapestry framework. You can also find more information about each of these at the official Tapestry Web page.

ActionLink DirectLink Image Radio Submit
Any ExceptionDisplay ImageSubmit RadioGroup TextArea
Block ExternalLink Insert RenderBlock TextField
Body FieldLabel InsertText RenderBody Upload
Button Foreach LinkSubmit Rollover ValidField
Checkbox Form ListEdit Script
Conditional Frame Option Select
DatePicker GenericLink PageLink ServiceLink
Delegator Hidden PropertySelection Shell

Contrib Library

Choose InspectorButton Palette TableFromPages TableValues
DateField MultiplePropertySelection PopupLink TableFormRows TableView
FormConditional NumericField Table TablePages ValidatingTextField
FormTable Otherwise TableColumns TableRows When

WML Library

Card Image Option Select Timer
Do Input Postfield SelectionField
Go OnEvent PropertySelection Setvar

High Level Interfaces and Data Flow

Developing in Tapestry requires not only using the provided components, learning the APIs, and XML component and page specification, but also understanding its main concepts and the logic flow of the framework.

There are several high-level concepts that developers need to know in order to use Tapestry successfully. One such conceptsis the Visit object. The Visit object holds information about a single client's visit to the Web page. This object is instantiated by the Engine and is maintained, serialized, and deserialized by it. This object can potentially be any custom object that implements a serializable interface and that is the only requirement; no other requirement is imposed. Under the hood, this object is stored persistently in the HttpSession.

Go to page: 1  2  Next  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Enterprise Java Archives

Data Sheet: IBM Information Server Blade
Is it time to make your move to the multi-threaded and parallel processing world? Find out!
Flash Demo: Learn how IBM Information Server Blade is easy to manage, highly scalable and efficient.
Intel Go Parallel Portal: Translating Multicore Power into Application Performance
Generate Complete .NET Web Apps in Minutes . Download Iron Speed Designer today.



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES