tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Tapestry > General Questions
Date Sat, 13 Oct 2012 00:10:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/12/_/styles/combined.css?spaceKey=TAPESTRY&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/TAPESTRY/General+Questions">General
Questions</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~hlship">Howard
M. Lewis Ship</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        "How do I upgrade from one version of Tapestry5 to another?"<br />
    </div>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >Many of the basic concepts in Tapestry
4 are still present in Tapestry 5, but refactored, improved, streamlined, and simplified.
 The basic concept of pages, templates and components are largely the same. Other aspects,
such as server-side event handling, is markedly different. <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3.
How do I upgrade from one version of Tapestry 5 to another? <br> <br>A lot of
effort goes into making an upgrade from one Tapestry 5 release to another go smoothly.  In
the general case, it is just a matter of updating the version number in your Maven {{build.xml}}
or Gradle {{build.gradle}} file and executing the appropriate commands (e.g., {{gradle idea}}
or {{mvn eclipse:eclipse}}) to bring your local workspace up to date with the latest binaries.
<br> <br>We make every effort to ensure backwards-compatibility; you should always
be able to upgrade and, at most, recompile your code. Tapestry is mostly coded in terms of
interfaces; those interfaces are stable to a point: interfaces your code is expected to implement
are usually completely frozen; interfaces your code is expected to invoke, such as the interfaces
to IoC services, are stable, but may have new methods added in a release; existing methods
are not changed. <br> <br>In _rare_ cases a choice is necessary between fixing
 bugs (or adding essential functionality) and maintaining stability; in those cases, an incompatible
change may be introduced. These are always discussed in detail in the [Release Notes] for
the specific release. You should always read the release notes before attempting an upgrade,
and always (really, _always_) be prepared to retest your application afterwards. <br>
<br>Note that you should be careful any time you make use of *internal* APIs (you can
tell an API is internal by the package name, {{org.apache.tapestry5.internal...}}. Internal
APIs may change _at any time_; there&#39;s no backwards-compatible guarantee. Please always
check on the documentation, or consult the user mailing list, to see if there&#39;s a
stable, public alternative.  If you do make use of internal APIs, be sure to get a discussion
going so that your needs can be met in the future by a stable, public API. <br> <br>A
final note: Tapestry incorporates your application&#39;s version number into the URLs
for JavaScript, CSS, and other assets exposed to the browser; these assets are cached on the
browser with the assumption that when the server-side assets are changed, the version number
(and thus the URL) will change as well.  This version number applies to framework-provided
assets as well as those specific to your application. <br> <br>Thus, whenever
you upgrade, you must change the {{tapestry.application-version}} [configuration symbol|Configuration]
as well. If you fail to do so, you will see odd behavior in some clients who may be running
a mix of old and new assets. This can result in execution errors or incorrect behavior in
your clients. <br> <br>Again, after an upgrade to a new version of Tapestry, change
your application version number as well to ensure that the latest version of all assets are
downloaded into your client&#39;s browsers. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Why are there both Request and
HttpServletRequest? <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/TAPESTRY/Frequently+Asked+Questions"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/TAPESTRY/Frequently+Asked+Questions">Frequently Asked Questions</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/TAPESTRY/Templating+and+Markup+FAQ">Templating
and Markup FAQ</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/TAPESTRY/Templating+and+Markup+FAQ"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<h2><a name="GeneralQuestions-GeneralQuestions"></a>General Questions</h2>

<h3><a name="GeneralQuestions-HowdoIgetstartedwithTapestry%3F"></a>How do
I get started with Tapestry?</h3>

<p>The easiest way to get started is to use <a href="http://maven.apache.org" class="external-link"
rel="nofollow">Apache Maven</a> to create your initial project; Maven can use an
<em>archetype</em> (a kind of project template) to create a bare-bones Tapestry
application for you.  See the <a href="/confluence/display/TAPESTRY/Getting+Started" title="Getting
Started">Getting Started</a> page for more details.</p>

<p>Even without Maven, Tapestry is quite easy to set up.  You just need to <a href="/confluence/display/TAPESTRY/Download"
title="Download">download</a> the binaries and setup your build to place them inside
your WAR's WEB-INF/lib folder. The rest is just some one-time <a href="/confluence/display/TAPESTRY/Configuration"
title="Configuration">configuration of the web.xml deployment descriptor</a>.</p>

<h3><a name="GeneralQuestions-WhydoesTapestryusePrototype%3FWhynotinsertfavoriteJavaScriptlibraryhere%3F"></a>Why
does Tapestry use Prototype?  Why not <em>insert favorite JavaScript library here</em>?</h3>

<p>An important goal for Tapestry is seamless DHTML and Ajax integration. To serve that
goal, it was important that the built in components be capable of Ajax operations, such as
dynamically re-rendering parts of the page. Because of that, it made sense to bundle a well-known
JavaScript library as part of Tapestry.</p>

<p>At the time (this would be 2006-ish), Prototype and Scriptaculous were well known
and well documented, and jQuery was just getting started.</p>

<p>The intent has always been to make this aspect of Tapestry pluggable. Work is underway
to <a href="/confluence/display/TAPESTRY/JavaScript+Rewrite" title="JavaScript Rewrite">reboot
Tapestry's JavaScript</a> as part of 5.4. This will introduce a modern layer of modularization,
and tease apart the entrenched dependency on Prototype.</p>

<h3><a name="GeneralQuestions-WhydoesTapestryhaveitsownInversionofControlContainer%3FWhynotSpringorGuice%3F"></a>Why
does Tapestry have its own Inversion of Control Container?  Why not Spring or Guice?</h3>

<p>An Inversion of Control Container is <em>the</em> key piece of Tapestry's
infrastructure. It is absolutely necessary to create software as robust, performant and extensible
as Tapestry.</p>

<p>Tapestry IoC includes a number of features that distinguish itself from other containers:</p>
<ul>
	<li>Configured in code, not XML</li>
	<li>Built-in extension mechanism for services: configurations and contributions</li>
	<li>Built-in aspect oriented programming model (service decorations and advice)</li>
	<li>Easy modularization</li>
	<li>Best-of-breed exception reporting</li>
</ul>


<p>Because Tapestry is implemented on top of its IoC container, and because the container
makes it easy to extend or replace any service inside the container, it is possible to make
the small changes to Tapestry needed to customize it to any project's needs.</p>

<h3><a name="GeneralQuestions-HowdoIupgradefromTapestry4toTapestry5%3F"></a>How
do I upgrade from Tapestry 4 to Tapestry 5?</h3>

<p>There is no existing tool that supports upgrading from Tapestry 4 to Tapestry 5;
Tapestry 5 is a complete rewrite.</p>

<p>Many of the basic concepts in Tapestry 4 are still present in Tapestry 5, but refactored,
improved, streamlined, and simplified.  The basic concept of pages, templates and components
are largely the same. Other aspects, such as server-side event handling, is markedly different.</p>

<h3><a name="GeneralQuestions-HowdoIupgradefromoneversionofTapestry5toanother%3F"></a>How
do I upgrade from one version of Tapestry 5 to another?</h3>

<p>A lot of effort goes into making an upgrade from one Tapestry 5 release to another
go smoothly.  In the general case, it is just a matter of updating the version number in your
Maven <tt>build.xml</tt> or Gradle <tt>build.gradle</tt> file and
executing the appropriate commands (e.g., <tt>gradle idea</tt> or <tt>mvn
eclipse:eclipse</tt>) to bring your local workspace up to date with the latest binaries.</p>

<p>We make every effort to ensure backwards-compatibility; you should always be able
to upgrade and, at most, recompile your code. Tapestry is mostly coded in terms of interfaces;
those interfaces are stable to a point: interfaces your code is expected to implement are
usually completely frozen; interfaces your code is expected to invoke, such as the interfaces
to IoC services, are stable, but may have new methods added in a release; existing methods
are not changed.</p>

<p>In <em>rare</em> cases a choice is necessary between fixing  bugs (or
adding essential functionality) and maintaining stability; in those cases, an incompatible
change may be introduced. These are always discussed in detail in the <a href="/confluence/display/TAPESTRY/Release+Notes"
title="Release Notes">Release Notes</a> for the specific release. You should always
read the release notes before attempting an upgrade, and always (really, <em>always</em>)
be prepared to retest your application afterwards.</p>

<p>Note that you should be careful any time you make use of <b>internal</b>
APIs (you can tell an API is internal by the package name, <tt>org.apache.tapestry5.internal...</tt>.
Internal APIs may change <em>at any time</em>; there's no backwards-compatible
guarantee. Please always check on the documentation, or consult the user mailing list, to
see if there's a stable, public alternative.  If you do make use of internal APIs, be sure
to get a discussion going so that your needs can be met in the future by a stable, public
API.</p>

<p>A final note: Tapestry incorporates your application's version number into the URLs
for JavaScript, CSS, and other assets exposed to the browser; these assets are cached on the
browser with the assumption that when the server-side assets are changed, the version number
(and thus the URL) will change as well.  This version number applies to framework-provided
assets as well as those specific to your application.</p>

<p>Thus, whenever you upgrade, you must change the <tt>tapestry.application-version</tt>
<a href="/confluence/display/TAPESTRY/Configuration" title="Configuration">configuration
symbol</a> as well. If you fail to do so, you will see odd behavior in some clients
who may be running a mix of old and new assets. This can result in execution errors or incorrect
behavior in your clients.</p>

<p>Again, after an upgrade to a new version of Tapestry, change your application version
number as well to ensure that the latest version of all assets are downloaded into your client's
browsers.</p>

<h3><a name="GeneralQuestions-WhyaretherebothRequestandHttpServletRequest%3F"></a>Why
are there both Request and HttpServletRequest?</h3>

<p>Tapestry's Request interface is <em>very</em> close to the standard HttpServletRequest
interface. It differs in a few ways, omitting some unneeded methods, and adding a couple of
new methods (such as <tt>isXHR()</tt>), as well as changing how some existing
methods operate. For example, <tt>getParameterNames()</tt> returns a sorted List
of Strings; HttpServletRequest returns an Enumeration, which is a very dated approach.</p>

<p>However, the stronger reason for Request (and the related interfaces Response and
Session) is to enable the support for Portlets at some point in the future. By writing code
in terms of Tapestry's Request, and not HttpServletRequest, you can be assured that the same
code will operate in both Servlet Tapestry and Portlet Tapestry.</p>

<style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/TAPESTRY/Frequently+Asked+Questions"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/TAPESTRY/Frequently+Asked+Questions">Frequently Asked Questions</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/TAPESTRY/Templating+and+Markup+FAQ">Templating
and Markup FAQ</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/TAPESTRY/Templating+and+Markup+FAQ"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/TAPESTRY/General+Questions">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23334922&revisedVersion=20&originalVersion=19">View
Changes</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message