ArticleslgStudy

computer science

Apache Tapestry

Apache Tapestry is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Apache Tapestry rather than just read about it. In short: Apache Tapestry is an open-source component-oriented Java web application framework conceptually similar to JavaServer Faces and Apache Wicket. Tapestry was created by Howard Lewis Ship, and was adopted by the Apache Software Foundation as a top-level project in 2006.

Apache Tapestry — main illustration
Apache Tapestry — illustration

Key takeaways

  • Apache Tapestry belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Apache Tapestry to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Apache Tapestry from memory before moving on to harder problems.

Reference excerpt

Apache Tapestry is an open-source component-oriented Java web application framework conceptually similar to JavaServer Faces and Apache Wicket. Tapestry was created by Howard Lewis Ship, and was adopted by the Apache Software Foundation as a top-level project in 2006. Tapestry emphasizes simplicity, ease of use, and developer productivity. It adheres to the Convention over Configuration paradigm, eliminating almost all XML configuration. Tapestry uses a modular approach to web development by having a strong binding between each user interface component (object) on the web page and its corresponding Java class. This component-based architecture borrows many ideas from WebObjects.

Notable features Live Class Reloading Tapestry monitors the file system for changes to Java page classes, component classes, service implementation classes, HTML templates and component property files, and it hot-swaps the changes into the running application without requiring a restart. This provides a very short code-save-view feedback cycle that is claimed to greatly improve developer productivity. Component-based Pages may be constructed with small nestable components, each having a template and a component class. Custom components are purportedly trivial to construct. Convention over configuration Tapestry uses naming conventions and annotations, rather than XML, to configure the application. Spare use of HTTPSession By making minimal use of the HTTPSession, Tapestry is designed to be highly efficient in a clustered, session-replicated environment. Post/Redirect/Get Most form submissions follow the Post/Redirect/Get (PRG) pattern, which reduces multiple form submission accidents and makes URLs friendlier and more bookmarkable, along with enabling the browser Back and Refresh buttons to operate normally. Inversion of Control (IoC) Tapestry is built on a lightweight Inversion of Control layer with similarities to Google Guice, but designed to make nearly all aspects of Tapestry's behavior configurable and replaceable.

Hello World Example A minimal, templated Tapestry application needs only three files:

HelloWorld.tml The (X)HTML template for the /helloworld page. Tapestry templates can contain any well-formed (X)HTML markup. HelloWorld.java The page class associated with the template. Here, it merely provides a *username* property that the template can access.

web.xml The servlet application Deployment Descriptor, which installs Tapestry as a servlet filter.

Class transformation Tapestry uses bytecode manipulation to transform page and component classes at runtime. This approach allows the page and component classes to be written as simple POJOs, with a few naming conventions and annotations potentially triggering substantial additional behavior at class load time. Tapestry versions 5.0, 5.1 and 5.2 used the Javassist bytecode manipulation library. Subsequent versions replaced Javassist with a new bytecode manipulation layer called Plastic that is based on ObjectWeb ASM.

Client-side support Tapestry 5 versions up through 5.3 bundled the Prototype and script.aculo.us JavaScript frameworks, along with a Tapestry-specific library, so as to support Ajax operations as first-class citizens. Third party modules are available to integrate jQuery instead of, or in addition to, Prototype/Scriptaculous. Starting with version 5.4, Tapestry includes a new JavaScript layer that removes built-in components' reliance on Prototype, allowing jQuery or another JavaScript framework to be plugged in. Version 5.4 also introduces support for JavaScript modules using the RequireJS module loading system.

Core principles The Tapestry project documentation cites four "principles" that govern all development decisions for Tapestry, starting with version 5 in 2008:

Static Structure, Dynamic Behavior—page and component structure is essentially static, eliminating the need to construct (and store in session memory) large page and component trees. Adaptive API—the framework is designed to adapt to the code, rather than having the code adapt to the framework Differentiate Public vs. Internal APIs—all APIs are explicitly "internal" (private) except those that are necessarily public. Ensure Backwards Compatibility—The Tapestry developers are reportedly committed to ensuring that upgrading to the latest version of Tapestry is always easy.

Criticism Tapestry has been criticized as not being backward-compatible across major versions, especially noted in the transition from version 4 to version 5, where no clean migration path was available for existing applications. Project team members have acknowledged this as a major problem for Tapestry's users in the past, and backward compatibility was made a major design goal for Tapestry going forward. From early on in the development of version 5, backward compatibility was listed as one of Tapestry's four new "Core Principles", and two of the other three were intended to make the evolution of the framework possible without sacrificing backward compatibility. Project team members claim that all Tapestry releases since 5.0 have been highly backward compatible. Early criticisms of Tapestry 5 also mentioned documentation as a shortcoming. Project members now claim that this deficiency has been largely addressed with a thoroughly revised and updated User's Guide and other documentation. Since version 5.0, Tapestry has bundled the Prototype and Scriptaculous JavaScript libraries. According to Howard Lewis Ship, in the 2008-2009 timeframe these were reasonable choices. Since then, however, Prototype's popularity has declined, and jQuery's has risen dramatically. In response, the Tapestry community developed modules that allowed jQuery to be used in addition to, or instead of, Prototype. Meanwhile, the current version of Tapestry, 5.4, removes the dependency on Prototype entirely, replacing it with a compatibility layer into which either jQuery or Prototype (or potentially any other JavaScript framework) can be plugged.

… excerpt ends here. Continue reading the full article.

Illustrations

Apache Tapestry illustration

Worked examples

Example 1 — a first encounter with Apache Tapestry

Start with the simplest possible case. Write down what Apache Tapestry claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Apache Tapestry before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Apache Tapestry ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Apache Tapestry

In research
Apache Tapestry appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Apache Tapestry in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Apache Tapestry is common in secondary-school and first-year university syllabi. It links to neighbouring topics Apache Software Foundation projects, Java enterprise platform, Web frameworks, so understanding it makes those chapters shorter.
In everyday life
Look for Apache Tapestry outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Apache Tapestry” →

How to study Apache Tapestry in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Apache Tapestry means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Apache Tapestry out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Apache Tapestry in simple terms?

Apache Tapestry is an open-source component-oriented Java web application framework conceptually similar to JavaServer Faces and Apache Wicket. Tapestry was created by Howard Lewis Ship, and was adopted by the Apache Software Foundation as a top-level project in 2006.

Why does Apache Tapestry matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Apache Tapestry?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Apache Tapestry.

Tags

  • Apache Software Foundation projects
  • Java enterprise platform
  • Web frameworks

Keep exploring