Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322904 - Support callout bindings for constructors
Summary: Support callout bindings for constructors
Status: NEW
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.7   Edit
Hardware: PC Linux
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-17 10:40 EDT by Stephan Herrmann CLA
Modified: 2011-08-27 10:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.