IDEA is aware that my class is referenced in Spring. I can refactor a String out to a Constant so how about a new feature that refactors out one step further into a contructor injection argument?
IDEA is aware that my class is referenced in Spring. I can refactor a String out to a Constant so how about a new feature that refactors out one step further into a contructor injection argument?
Introduce field: select Initialize in constructor.
Introduce parameter.
Does IDEA handle the spring config portion of that refactoring? I don't know, but it should.
I wasn't aware of that functionality. I explorered the refactor menu a bit more today and discovered a couple more interesting things. However, as far as I can tell, although it does refactor to a class contructor it doesn't update the spring config. A single refactor to spring option would be excellent though.
I wasn't aware of that functionality. I explorered the refactor menu a bit more today and discovered a couple more interesting things. However, as far as I can tell, although it does refactor to a class contructor it doesn't update the spring config. A single refactor to spring option would be excellent though.
I agree. To me that is a bug in the refactoring code for introduce parameter.
Hmm, actually one refactoring that would be useful is "Introduce injected field", which would be similar to Introduce Field, but creates getters/setters automatically and moves the value into supported IoC container configurations.
There are intentions for introducing constructor and setter dependencies. But handle with care, there are still problems associated with these actions, see:
>> I wasn't aware of that functionality. I explorered the refactor menu >> a bit more today and discovered a couple more interesting things. >> >> However, as far as I can tell, although it does refactor to a class >> contructor it doesn't update the spring config. >> >> A single refactor to spring option would be excellent though. >>
I agree. To me that is a bug in the refactoring code for introduce parameter.
Please file a YouTrack issue.
-- Dmitry Jemerov Development Lead JetBrains, Inc. http://www.jetbrains.com/ "Develop with Pleasure!"
On 3/19/2010 1:45 AM, opticyclic wrote:
Introduce field:
select Initialize in constructor.
Introduce parameter.
Does IDEA handle the spring config portion of that refactoring? I don't
know, but it should.
I wasn't aware of that functionality. I explorered the refactor menu a bit more today and discovered a couple more interesting things.
However, as far as I can tell, although it does refactor to a class contructor it doesn't update the spring config.
A single refactor to spring option would be excellent though.
On 3/19/2010 5:55 PM, opticyclic wrote:
I agree. To me that is a bug in the refactoring code for introduce
parameter.
Hmm, actually one refactoring that would be useful is "Introduce
injected field", which would be similar to Introduce Field, but creates
getters/setters automatically and moves the value into supported IoC
container configurations.
There are intentions for introducing constructor and setter dependencies. But handle with care, there are still problems associated with these actions, see:
http://youtrack.jetbrains.net/issue/IDEA-22574
http://youtrack.jetbrains.net/issue/IDEA-21273
Please vote for the above to be fixed!
Hello Daniel,
>> I wasn't aware of that functionality. I explorered the refactor menu
>> a bit more today and discovered a couple more interesting things.
>>
>> However, as far as I can tell, although it does refactor to a class
>> contructor it doesn't update the spring config.
>>
>> A single refactor to spring option would be excellent though.
>>
Please file a YouTrack issue.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"