tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Tapestry > Ordering by Constraints
Date Thu, 23 Dec 2010 01:21:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/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/Ordering+by+Constraints">Ordering
by Constraints</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~bobharner">Bob
Harner</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Renamed<br />
    </div>
        <br/>
                         <h4>Changes (0)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <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
class='ScrollbarPrevIcon'><a href="/confluence/display/TAPESTRY/Service+Implementation+Reloading"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/TAPESTRY/Service+Implementation+Reloading">Service
Implementation Reloading</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/TAPESTRY/IoC"><img border='0' align='middle' src='/confluence/images/icons/up_16.gif'
width='8' height='8'></a></sup><a href="/confluence/display/TAPESTRY/IoC">IoC</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/TAPESTRY/IoC+-+symbols">IoC
- symbols</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/TAPESTRY/IoC+-+symbols"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>

<h1><a name="OrderingbyConstraints-OrderingbyConstraints"></a>Ordering by
Constraints</h1>

<p>Tapestry IoC has two specific areas where it must put some form of contribution into
a specific order:</p>

<ul>
	<li><a href="/confluence/display/TAPESTRY/Tapestry+IoC+Configuration#TapestryIoCConfiguration-OrderedList">Ordered
Configurations</a>, where different modules may contribute into a service's configuration</li>
	<li><a href="/confluence/display/TAPESTRY/Tapestry+IoC+Decorators" title="Tapestry
IoC Decorators">Service Decorators</a> which must be applied to services from a number
of modules.<br/>
In both these cases, objects (either contributions to a configuration, or decorators) are
assigning qualified ids, simple ids qualified with the containing/contributing module's id.</li>
</ul>


<p>Because the contributions can come from different modules, and there isn't a specific
order in which the service contribution methods are invoked, there is no natural ordering
of the contributed objects.</p>

<p>To resolve this, <em>constraints</em> are applied to each contribution.
These constraints control what other objects must come before a contribution, or come after.</p>

<p>The constraints are specified using the @<a href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Order.html"
class="external-link" rel="nofollow">Order</a> annotation (for service decorator
methods), or as variable arguments at the end of the add() method for ordered configurations.</p>

<p>Often a single contribution will have more than one constraint.</p>

<h1><a name="OrderingbyConstraints-ConstraintTypes"></a>Constraint Types</h1>

<p>Each constraint string begins with a prefix, <tt>before:</tt> or <tt>after:</tt>,
used to identify the type of constraint.</p>

<p>The remainder of the constraint string is a comma-separated list of <em>patterns</em>.
The contributed object will be ordered before or after the contributions identified by the
patterns.</p>

<p><a name="OrderingbyConstraints-MatchPatterns"></a></p>
<h1><a name="OrderingbyConstraints-ConstraintMatchPatterns"></a>Constraint
Match Patterns</h1>

<p>A constraint match pattern is used to select one or more objects by their id.</p>

<p>Match patterns support a very simple kind of wildcard matching. A <tt>&#42;</tt>
(asterisk character) may appear at the start and/or end of the pattern, and it will match
zero or more characters there. Thus you can have patterns such as <tt>Data&#42;</tt>
or <tt>&#42;Logic</tt> or even <tt>&#42;User&#42;</tt>.</p>

<p>Matching is <a href="/confluence/display/TAPESTRY/Case+Insensitivity" title="Case
Insensitivity">case insensitive</a>.</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
class='ScrollbarPrevIcon'><a href="/confluence/display/TAPESTRY/Service+Implementation+Reloading"><img
border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td
width='33%' class='ScrollbarPrevName'><a href="/confluence/display/TAPESTRY/Service+Implementation+Reloading">Service
Implementation Reloading</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/TAPESTRY/IoC"><img border='0' align='middle' src='/confluence/images/icons/up_16.gif'
width='8' height='8'></a></sup><a href="/confluence/display/TAPESTRY/IoC">IoC</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/TAPESTRY/IoC+-+symbols">IoC
- symbols</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/TAPESTRY/IoC+-+symbols"><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/Ordering+by+Constraints">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23338485&revisedVersion=10&originalVersion=9">View
Changes</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message