[otj-users] Callin methods
Marco Mosconi
mosconi at cs.tu-berlin.de
Mon Feb 4 12:15:37 CET 2008
Hi Michael,
from your example I guess that you want to make role methods available
on the base class, i.e. implicitly enhancing its type to be conform to
the role type. Such kind of invasive type modification (like
introduction in AspectJ) is not supported in Object Teams.
It is part of the role concept of OT that roles are only meaningful in a
special context (their team/collaboration). Clients of the original base
class are not aware of the role methods at all, and clients knowing the
team context would use the role instead of the base.
But your scenario would work the other way round: a role class can be
implemented to completely decorate its base using "inferred callouts".
Clients of the role class can then access features of the base class
transparently. See
https://svn.objectteams.org/trac/ot/wiki/OtPatterns/TransparentRole for
more information and an example.
Regards,
Marco
Michael Pradel schrieb:
>>> Just another question... Is it possible to call role methods from a base
>>>> class (i.e. callin methods) without a corresponding method in the base
>>>> class, i.e., without using <- ?
>> what would then be the trigger for the role method call? Would you like to
>> call it explicitly, like a regular method or do you think of some kind of
>> pointcut other than method execution?
>
> Yes, I'd like to call a role method directly. Shouldn't that be possible
> whenever the context (i.e. the team instance) is given, e.g.
>
> MyTeam t = new MyTeam();
> within(t) {
> baseObject.roleMethod();
> }
>
> I assume that there is a role type having a method m that is a played by
> the class of baseObject.
>
>
> Michael
>
> _______________________________________________
> otj-users mailing list
> otj-users at objectteams.org
> http://www.objectteams.org/cgi-bin/mailman/listinfo/otj-users
--
Dipl.-Inform. Marco Mosconi
Technische Universität Berlin
Fak. IV, Fachg. Softwaretechnik
More information about the otj-users
mailing list