blob: 78876816c2f08ffa6fa0a6aa629cb800b7d07b57 [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.1</title>
</head>
<body class="otdt">
<div id="content">
<table class="nav">
<tr>
<td class="back"><a id="top"></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="s7.2.html" rel="next">&sect;7.2&nbsp;Confined roles&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</a></div>
<div class="sect depth2" id="s7.1">
<h2 class="sect">&sect;7.1&nbsp;Opaque roles<a class="img" href="s7.1.html"
title="PermaLink to &sect;7.1&nbsp;Opaque roles"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
alt="" /></a></h2>
<p>The purpose of the two <code>IConfined</code> interfaces (see <a href="s6.2.a.html"
title="&sect;6.2.(a)&nbsp;Interfaces for role encapsulation"
class="sect">&sect;6.2.(a)</a>) is to define
<strong>opaque roles</strong>: Any role implementing <code>IConfined</code>
can be externalized using this type, such that external clients
cannot access any features of the role. The type <code>IConfined</code>
exposes no features and references of this type cannot be widened
to any type not even to <code>java.lang.Object</code>.
<br />
If the actual role type is furthermore invisible outside the team
(by not declaring it <code>public</code>), it is perfectly safe to externalize
such roles using type <code>IConfined</code> (which is a public interface)
and pass them back to the owning team. The encapsulation
of the team is in no way breached by externalizing opaque roles,
which can only be used as a handle into internal state of the team.
</p>
<p>The difference between the two mentioned interfaces is that
<code>ITeam.IConfined</code> requires to use this type or any subtype
as externalized role. Such a reference contains the information of
the enclosing team. Even stricter control can be imposed using the
regular interface <code>IConfined</code>. Here not even team membership
is visible to clients using a reference of this type.
</p>
</div>
<table class="nav">
<tr>
<td class="back"></td>
<td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
<td class="next"><a href="s7.2.html" rel="next">&sect;7.2&nbsp;Confined roles&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s7.html" rel="section">&sect;7&nbsp;Role Encapsulation</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.1 &mdash; last modified: 2013-05-28
</div>
</body>
</html>