blob: c468782a67a486547fd95b798544bc574d7478c5 [file] [log] [blame]
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "../xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../css/ot.css" />
<link rel="stylesheet" type="text/css" href="../css/otjld.css" />
<title>OT/J Language Definition v1.3</title>
</head>
<body class="otdt">
<div id="content">
<table class="nav">
<tr>
<td class="back"><a id="top"></a><a href="s2.7.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(b)&nbsp;Stacking</a></td>
<td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
<td class="next"><a href="s2.7.d.html" rel="next">&sect;2.7.(d)&nbsp;Implicit playedBy specialization&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
<div class="subsect depth3" id="s2.7.c">
<h4 class="subsect">&sect;2.7.(c)&nbsp;<span class="title">Layering</span><a class="img" href="s2.7.c.html" title="PermaLink to (c)&nbsp;Layering"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
alt="" /></a></h4>
<p>If roles of a team <code>Secondary</code> are played by roles of another team <code>Primary</code>
(i.e., base classes are roles), the team <code>Secondary</code> defines a <strong>layer</strong> over the team <code>Primary</code>.
Such layering requires a final reference <code>anchor</code> from <code>Secondary</code> to an instance of <code>Primary</code>.
All playedBy declarations within <code>Secondary</code> specify their base classes anchored to that final link <code>anchor</code>.
</p><img src="../images/Layering.png" alt="Team layering example" /><p>Due to the anchored base types, layered teams implicitly support the following guarantee:
all base objects of roles of <code>Secondary</code> are contained within the team instance specified by the link <code>anchor</code>.
If roles of <code>Secondary</code> contain any callin bindings to non-static base methods, these will be triggered only
when a base method is invoked on a base instance contained in the team specified by <code>anchor</code>.
<br />
In accordance with <a href="s2.6.a.html"
title="&sect;2.6.(a)&nbsp;Externalized roles of a base team"
class="sect">&sect;2.6.(a)</a> the anchor in such anchored playedBy declarations
could also be the pseudo identifier <code>base</code>, provided that <code>Secondary</code> is a nested team,
which has a playedBy binding to <code>Primary</code> as its base class.
This situation is part of the second example <a href="s2.7.d.html"
title="&sect;2.7.(d)&nbsp;Implicit playedBy specialization"
class="sect">below (&sect;2.7.(d))</a> (see <code>T1 playedBy TB1</code>).
</p>
</div>
<table class="nav">
<tr>
<td class="back"><a href="s2.7.b.html" rel="prev">&lt;&lt;&nbsp;&sect;2.7.(b)&nbsp;Stacking</a></td>
<td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
<td class="next"><a href="s2.7.d.html" rel="next">&sect;2.7.(d)&nbsp;Implicit playedBy specialization&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s2.html" rel="section">&sect;2&nbsp;Role Binding</a>&nbsp;&gt;&nbsp;<a class="nav" href="s2.7.html" rel="section">&sect;2.7&nbsp;Advanced structures</a></div>
</div>
<div id="footer">
<hr /><a class="w3c img" href="http://jigsaw.w3.org/css-validator/check/referer"
shape="rect"><img src="../images/valid-css2-blue.png" alt="Valid CSS!" height="31" width="88" /></a><a class="w3c img" href="http://validator.w3.org/check?uri=referer" shape="rect"><img src="../images/valid-xhtml10-blue.png" alt="Valid XHTML 1.0 Strict" height="31"
width="88" /></a><address>&copy; Stephan Herrmann, Christine Hundt, Marco Mosconi</address>
OT/J version 1.3 &mdash; last modified: 2010-10-05
</div>
</body>
</html>