blob: 898bb28a4b97d426e058831d14e9a743956abfeb [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></td>
<td class="top"><a href="index.html" rel="contents">&uarr;&nbsp;Table of Contents&nbsp;&uarr;</a></td>
<td class="next"><a href="s1.2.html" rel="next">&sect;1.2&nbsp;Role classes and objects&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</a></div>
<div class="sect depth2" id="s1.1">
<h2 class="sect">&sect;1.1&nbsp;Team classes<a class="img" href="s1.1.html"
title="PermaLink to &sect;1.1&nbsp;Team classes"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png"
alt="" /></a></h2>
<div class="syntaxlink"><a href="sA.html#sA.1.1" title="&sect;A.1.1&nbsp;ClassDeclaration"
class="syntax">&rarr;&nbsp;Syntax&nbsp;&sect;A.1.1</a></div>
<p>A class declared with the modifier <code>team</code> is a <em>team class</em> (or team for short).
</p>
<div class="listing example frame">
<table class="listing">
<tr class="line odd">
<td class="ln">1</td>
<td><pre><b>public</b> <em><b>team</b> <b>class</b> MyTeamA</em> {</pre></td>
</tr>
<tr class="line even">
<td class="ln">2</td>
<td><pre> ...</pre></td>
</tr>
<tr class="line odd">
<td class="ln">3</td>
<td><pre>}</pre></td>
</tr>
</table>
</div>
<p>Teams are meant as containers for <em>roles</em>, which are defined in the following
paragraphs.
</p>
<div class="listing example frame">
<table class="listing">
<tr class="line odd">
<td class="ln">1</td>
<td><pre><b>public</b> <b>team</b> <b>class</b> MyTeamA {</pre></td>
</tr>
<tr class="line even">
<td class="ln">2</td>
<td><pre> <b>public</b> <em><b>class</b> MyRole</em></pre></td>
</tr>
<tr class="line odd">
<td class="ln">3</td>
<td><pre> ...</pre></td>
</tr>
<tr class="line even">
<td class="ln">4</td>
<td><pre> }</pre></td>
</tr>
<tr class="line odd">
<td class="ln">5</td>
<td><pre>}</pre></td>
</tr>
</table>
</div>
<p>Teams introduce a new variant of inheritance for contained role classes
(see <a href="s1.3.1.html"
title="&sect;1.3.1&nbsp;Acquisition and implicit inheritance of role classes"
class="sect">&sect;1.3.1</a> below).
Other properties of teams, which are defined in later sections, are:
</p>
<ul>
<li>Team activation (<a href="s5.html" title="&sect;5&nbsp;Team Activation" class="sect">&sect;5</a>)
</li>
<li>Abstractness and instantiation (<a href="s2.5.html" title="&sect;2.5&nbsp;Abstract Roles" class="sect">&sect;2.5</a>)
</li>
<li>Declared lifting in team methods (<a href="s2.3.2.html" title="&sect;2.3.2&nbsp;Declared lifting" class="sect">&sect;2.3.2</a>)
</li>
<li>Reflective functions defined in <code>org.objectteams.ITeam</code> (<a href="s6.1.html" title="&sect;6.1&nbsp;Reflection" class="sect">&sect;6.1</a>)
</li>
</ul>
<p>Apart from these differences, team classes are regular Java classes with
methods and fields, whose instances are regular Java objects.
</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="s1.2.html" rel="next">&sect;1.2&nbsp;Role classes and objects&nbsp;&gt;&gt;</a></td>
</tr>
</table>
<div class="breadcrumb"><a class="nav" href="s1.html" rel="section">&sect;1&nbsp;Teams and Roles</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-06-08
</div>
</body>
</html>