Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "OTJ Primer"
m (→Role Containment) |
|||
Line 34: | Line 34: | ||
* Roles preferably communicate with other roles. | * Roles preferably communicate with other roles. | ||
* Roles can be confined to their enclosing team to protect them against external access | * Roles can be confined to their enclosing team to protect them against external access | ||
− | * Data-flows between a team | + | * Data-flows between a team and its outside applies '''translation polymorphism''' to translate between roles and bases: |
** sending a role object to the outside applies '''lowering''' (role-to-base translation) | ** sending a role object to the outside applies '''lowering''' (role-to-base translation) | ||
** sending a base object into a team applies '''lifting''' (base-to-role translation) | ** sending a base object into a team applies '''lifting''' (base-to-role translation) | ||
Line 42: | Line 42: | ||
---- | ---- | ||
+ | |||
===[[OTJ_Primer/Team_Inheritance|Team Inheritances]]=== | ===[[OTJ_Primer/Team_Inheritance|Team Inheritances]]=== | ||
Revision as of 04:19, 3 June 2011
The programming language OT/J introduces two new kinds of classes
However, it is much more interesting to look at what happens between these things.
Here, OT/J introduces the following major relations:
Role Playing
Role classes/objects are playedBy base classes/objects. The communication between the two part objects is defined using
- callout method bindings for forwarding role-to-base
- callin method bindings for intercepting method calls base-to-role
Role Containment
Role classes/objects are contained in a team instance.
- Roles preferably communicate with other roles.
- Roles can be confined to their enclosing team to protect them against external access
- Data-flows between a team and its outside applies translation polymorphism to translate between roles and bases:
- sending a role object to the outside applies lowering (role-to-base translation)
- sending a base object into a team applies lifting (base-to-role translation)
- Team activation controls the enablement of callin bindings
→ Details on Role Containment ...
Team Inheritances
- A team class can be sub-classed including all its contained roles (similar to Java classes with inner classes)
- A sub-team can override any of its inherited roles (different from Java inner classes).
- An overriding role implicitly inherits from its overridden version.