Poster Abstract
Dynamism in ObjectTeams
Stephan Herrmann, Christine Hundt, and Katharina Mehner
Technical University Berlin
ObjectTeams. The aspect-oriented programming language ObjectTeams/Java
takes an approach based on views and collaborations. ObjectTeams
encapsulates aspects in potentially interacting roles (views)
whereby role instances are contained in team instances (collaborations).
Roles can be used for aspectizing programs by decorating classes in three
major ways, which can be combined freely:
-
Intercepting and augmenting control flow.
-
Adding new behaviour to classes and object.
-
Forwarding role messages to existing objects.
The poster presents the various dimensions of dynamism realized
in ObjectTeams.
1. Deployment or activation time of aspects. This dimension
identifies which aspects rsp. roles are active and for which scope. Roles
for decorating objects are created implicitly with further fine grained
control. ObjectTeams allows to control:
-
for which object instances these role instances are activated.
-
for which duration these role instances are activated.
All this is accomplished through controling the activation of team
instances in which roles are contained and encapsulated. Roles
can be activated and deactivated per team instance at runtime, either for
the entire application or for a block of statements. Thus, aspect activation
is moulded into the language itself in an imperative manner and completely
controled at runtime.
2. Dynamic binding of aspects. This dimension is in analogy
to object-oriented polymorphism, which allows to determine the most suitable
method implementation at runtime. In a context where objects are decorated
with roles this issue arises in two additional flavours, namely role-object
binding and role polymorphism.
-
During role instance creation the most suitable role type has to be determined.
This involves analysis of the team inheritance and the role inheritance
hierarchies.
-
The most suitable implementation of the desired role method has to be determined.
3. Aspect weaving time. We view weaving not as a feature in its
own right but merely as a support which allows for the desired behaviour
according to the previous two dimensions. Weaving is deferred to load-time
which simplifies organisational issues like configuration management, build
management, and deployment.
4. Definition time of aspects. Currently, ObjectTeams
does not support dynamic, i.e., runtime, definition of roles and teams.
We envision a reflection-based solution for this extending the Java class
loading mechanism at runtime.