tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Tapestry > Limitations
Date Tue, 17 Aug 2010 17:52:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/8/_/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/Limitations">Limitations</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~hlship">Howard
M. Lewis Ship</a>
    </h4>
        <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" > <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words">---<span
class="diff-added-chars"style="background-color: #dfd;">-</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{display-footnotes} <br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="Limitations-Limitations"></a>Limitations</h2>

<h3><a name="Limitations-HowdoIaddnewcomponentstoanexistingpagedynamically%3F"></a>How
do I add new components to an existing page dynamically?</h3>

<p>The short answer here is: <b>you don't</b>. The long answer here is <b>you
don't have to, to get the behavior you desire</b>.</p>

<p>One of Tapestry basic values is high scalability: this is expressed in a number of
ways, reflecting scalability concerns within a single server, and within a cluster of servers.</p>

<p>Although you code Tapestry pages and components as if they were ordinary POJOs<style
type='text/css'>
.FootnoteMarker, .FootnoteNum a {
  background: transparent url(/confluence/download/resources/com.adaptavist.confluence.footnoteMacros:footnote/gfx/footnote.png)
no-repeat top right;
  padding: 1px 2px 0px 1px;
  border-left: 1px solid #8898B8;
  border-bottom: 1px solid #6B7C9B;
  margin: 1px;
  text-decoration: none;
}
.FootnoteNum a {
  margin-top: 2px;
  margin-right: 0px;
}
.FootnoteNum {
  font-size: x-small;
  text-align: right;
  padding-bottom: 4px;
}
.footnote-th1 {
  text-align: right;
}
.Footnote {
  padding-left: 7px;
  margin-bottom: 4px;
  border: 1px none #DDDDDD;
  writingMode: tb-rl;
}
.accessibility {
     display: none;
     visibility: hidden;
}
@media aural,braille,embossed {
        .FootnoteMarker, .FootnoteNum a {
         border: 1px solid #000000;
         background: #ffffff none;
    }
    .accessibility {
         display: run-in;
         visibility: visible;
    }
}
</style>
<script type='text/javascript' language='JavaScript'>
//<!--\n
var effectInProgress = {};
var despamEffect = function (id,effectType,duration) {
  if ((effectInProgress[id]) || (typeof(Effect)=="undefined") || (typeof(Effect[effectType])=="undefined"))
return;
  new Effect[effectType](id);
  effectInProgress[id]=true;
  setTimeout('effectInProgress[\"'+id+'\"]=false;',duration*1000);
};
var oldFootnoteId = '';
var footnoteHighlight = function(id,pulsateNum) {
  if (oldFootnoteId!='') document.getElementById('Footnote'+oldFootnoteId).style['borderStyle']
= 'none';
  oldFootnoteId = id;
  document.getElementById('Footnote'+id).style['borderStyle'] = 'solid';
  despamEffect('Footnote'+id,'Highlight',1)
  if (pulsateNum) despamEffect('FootnoteNum'+id,'Pulsate',3)
}
var footnoteMarkerHighlight = function(id) {
  if (oldFootnoteId!='') document.getElementById('Footnote'+oldFootnoteId).style['borderStyle']
= 'none';
  oldFootnoteId = '';
  despamEffect('FootnoteMarker'+id,'Pulsate',3)
}
//-->
</script>

<sup id='FootnoteMarker1'>
    <a name='FootnoteMarker1'
        href='#Footnote1'
        onClick='footnoteHighlight("1",true);'
        alt='Footnote: Click here to display the footnote'
        title='Footnote: Click here to display the footnote'
        class='FootnoteMarker'>
            1
    </a>
</sup>
, as deployed by Tapestry they are closer to a traditional servlet: a single instance of each
page services requests from multiple threads. Behind the scenes, Tapestry transforms you code,
rewriting it on the fly.</p>

<p>What this means is that <em>any</em> incoming request must be handled
by a <em>single page instance</em>. Therefore, Tapestry enforces the concept of
<b>static structure, dynamic behavior</b>.</p>

<p>Tapestry provides quite a number of ways to vary what content is rendered, well beyond
simple conditionals and loops. It is possible to "drag in" components from other pages when
rendering a page (other FAQs will expand on this concept). The point is, that although a Tapestry
page's structure is very rigid, the order in which the components of the page render does
not have to be top to bottom.</p>


<h3><a name="Limitations-Whydoesn%27tmyserviceimplementationreloadwhenIchangeit%3F"></a>Why
doesn't my service implementation reload when I change it?</h3>

<p>Live service reloading has some limitations; basically, the implementation only reloads
if Tapestry instantiated it directly. Consider the following example module:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
<span class="code-keyword">public</span> <span class="code-keyword">static</span>
void bind(ServiceBinder binder)
{
  binder.bind(ArchiveService.class, ArchiveServiceImpl.class);
}

<span class="code-keyword">public</span> <span class="code-keyword">static</span>
JobQueue buildJobQueue(MessageService messageService, Map&lt;<span class="code-object">String</span>,Job&gt;
configuration)
{
  JobQueueImpl service = <span class="code-keyword">new</span> JobQueueImpl(configuration);

  messageService.addQueueListener(service);
 
  <span class="code-keyword">return</span> service;
}
</pre>
</div></div>

<p>ArchiveService is reloadable, because Tapestry instantiates <tt>ArchiveServiceImpl</tt>
itself.  On the other hand, Tapestry invokes <tt>buildJobQueue()</tt> and it is
your code inside the method that instantiates <tt>JobQueueImpl</tt>, so the JobQueue
service will not be reloadable.</p>

<p>Finally, only classes whose class files are stored directly on the file system, and
not packaged inside JARs, are ever reloadable ... generally, only the services of the application
being built (and not services from libraries) will be stored on the file system. This reflects
the intent of reloading: as an agile development tool, but not something to be used in deployment.</p>


<hr />
<p><table class='Footnotes' style='width: 100%; border:none;' cellspacing='0' cellpadding='0'
summary='This table contains one or more notes for references made elsewhere on the page.'>
  <caption class='accessibility'>Footnotes</caption>
  <thead class='accessibility'>
    <tr class='accessibility'>
      <th class='accessibility' id='footnote-th1'>Reference</th>
      <th class='accessibility' id='footnote-th2'>Notes</th>
    </tr>
  </thead>
  <tbody>
    <tr name='Footnote1'>
      <td valign='top' class='FootnoteNum' headings='footnote-th1'>
        <a href='#FootnoteMarker1'
          onClick='footnoteMarkerHighlight("1");'
          onMouseOver='footnoteHighlight("1",false);'
          alt='Footnote: Click to return to reference in text'
          title='Footnote: Click to return to reference in text'
          id='FootnoteNum1'>
            1
        </a>
      </td>
      <td id='Footnote1'
        valign='top'
        width='100%'
        class='Footnote'
        headings='footnote-th2'>
          Plain Old Java Object. Tapestry does not require you to extend any base classes
or implement any special interfaces.
      </td>
    </tr>
  </tbody>
</table></p>
    </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/Limitations">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23334928&revisedVersion=6&originalVersion=5">View
Changes</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message