| <!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">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="s2.5.b.html" rel="next">§2.5.(b) Relevant roles >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">§2 Role Binding</a> > <a class="nav" href="s2.5.html" rel="section">§2.5 Abstract Roles</a></div> |
| <div class="subsect depth3" id="s2.5.a"> |
| <h4 class="subsect">§2.5.(a) <span class="title">Using abstract classes for creation</span><a class="img" href="s2.5.a.html" |
| title="PermaLink to (a) Using abstract classes for creation"><img style="vertical-align:text-top;margin-left:5px;" src="../images/permalink.png" |
| alt="" /></a></h4> |
| <p>Abstract role classes can indeed be used for object creation. |
| The effect of such a statement is that the team must be |
| marked <code>abstract</code>. Only those sub-teams are concrete |
| that provide concrete versions for all role classes used in |
| creation expressions.<br /> |
| This includes the case, where a |
| super-team has a concrete role class and creates |
| instances of this role class and only the sub-team changes |
| the status of this role class to abstract. Also here |
| the sub-team must be marked abstract, because it contains |
| an abstract role class that is used in creation expressions. |
| |
| </p> |
| <div class="note"> |
| <h5>Interpretation:</h5> |
| Since the type in a role creation expression is late-bound relative to the enclosing team instance, abstract role classes |
| can be seen |
| as the hook in a <strong>template&hook pattern</strong> that is raised from the method level to the class level: |
| A super-team may already refer to the constructor of an abstract role class, |
| only the sub-team will provide the concrete role class to fill the hook with the necessary implementation. |
| |
| </div> |
| </div> |
| <table class="nav"> |
| <tr> |
| <td class="back"></td> |
| <td class="top"><a href="index.html" rel="contents">↑ Table of Contents ↑</a></td> |
| <td class="next"><a href="s2.5.b.html" rel="next">§2.5.(b) Relevant roles >></a></td> |
| </tr> |
| </table> |
| <div class="breadcrumb"><a class="nav" href="s2.html" rel="section">§2 Role Binding</a> > <a class="nav" href="s2.5.html" rel="section">§2.5 Abstract 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>© Stephan Herrmann, Christine Hundt, Marco Mosconi</address> |
| OT/J version 1.3 — last modified: 2011-05-15 |
| </div> |
| </body> |
| </html> |