[otj-users] several errors

Marco Mosconi mosconi at cs.tu-berlin.de
Sun Jun 29 20:49:40 CEST 2008


Hi,

> Why does your SalesPointBinder both implement SalesPoint and is played by it? 
> Usually roles change the behavior of their base class or add to it, and do 
> not share the same interface. Is there a special reason why you need to do 
> that? (This *might* also be a reason for the errors you get -- I didn't try 
> it, but I'd guess that you're the first to try this :-] )
I think he tries to realize some "transparent base wrapper" by declaring 
the same interface for role and base.
In combination with inferred callouts this can be useful to completely 
decorate a base with a role. This pattern is also documented in
https://svn.objectteams.org/trac/ot/wiki/OtPatterns/TransparentRole

Unfortunately, "playedBy <interface>" is not yet supported. So, for now 
one has to use at least an abstract class to bind to. In Ralfs example, 
introducing an abstract class AbstractSalesPoint and binding to it would 
do the job. The implements clause remains correct.

Best regards,
Marco



More information about the otj-users mailing list