Bug 76926 - Add new CDI parameter to consructor from field. [refactoring]
Summary: Add new CDI parameter to consructor from field. [refactoring]
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2004-10-25 08:08 EDT by Paul Hammant CLA
Modified: 2009-08-30 02:18 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 Paul Hammant CLA 2004-10-25 08:08:17 EDT
This is a new refactoring operation.

Notes - 
  SDI = Setter Depenency Injection
  CDI = Constructor Depenency Injection
Both as defined in http://www.martinfowler.com/articles/injection.html 

A member variable/field can have a Constructor Dependency Injection parameter
added for it. The Constructors can be changed en masse, or duplicated. Field can
optionally go final. Consider:

class Apple {
  final Orange orange;
  Banana banana;
  public Apple(Orange o) {
    orange = o;
  }
  public Apple() {
    orange = new DefaultOrange();
  }
}

if banana were selected, and the 'add CDI parameter to ctor' were actioned, the
result would be:

class Apple {
  final Orange orange;
  final Banana banana;
  public Apple(Orange o, Banana banana) {
    orange = o;
    this.banana = banana;
  }
  public Apple(Banana banana) {
    orange = new DefaultOrange();
    this.banana = banana;
  }
}
Comment 1 Jerome Lanneluc CLA 2004-10-25 09:56:41 EDT
Moving to JDT UI for comments.
Comment 2 Dirk Baeumer CLA 2004-10-26 05:26:32 EDT
Parts of this can currently be done using change method signature. 

Time permitted.
Comment 3 Denis Roy CLA 2009-08-30 02:18:18 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.