Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322904

Summary: Support callout bindings for constructors
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTJAssignee: Project Inbox <objectteams.otj-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P4    
Version: 0.7   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Stephan Herrmann CLA 2010-08-17 10:40:17 EDT
This is an RFE to support callout bindings for constructors.

Normally, this is not needed because creating a role together with its base can be achieved by a custom role constructor invoking a base constructor.

However, by supporting callout to a base class constructor a slightly different semantics can be provided: such a callout would first create the base instance and only then create the role using the regular lifting mechanism.

If a base class has a custom equals method, the newly created base may actually be equal to another base for which a role already exists, thus invoking the callout bound constructor can indeed re-use an existing role.

A proposed syntax would be

  protected class MyRole playedBy MyBase {
    MyRole(T arg) -> MyBase(T arg);
  }
Comment 1 Stephan Herrmann CLA 2011-08-27 10:23:02 EDT
Reducing priority as this RFE is relevant only for a very rare situation.