Generate Spring Setter Dependency

Hi all,

I'm currently using IntelliJ 7.0M1b, and I noticed something new (and cool! ;)): Generate Spring Setter Dependency. It automatically inserts a setter in my code, selects the right type of object, and also changes the applicationContext so the bean is add there also. Great stuff!

There's only one strange thing here: It add's the implementation class as a dependency, and not the interface. What it currently does is this:


3 things can be noticed here:
1) Why the Impl (I can image: I use the impl in my spring config... but having the impl version as a dependency in my code is quite not useful..)
2) Why the foo? Why not : 'productDao' ?
3) Where's the field? Now it only adds a dummy method which actually does nothing.

to fix this, I have to rename the property in the code, in the xml, rename the foo, and add assign (and create) the correct field... To me, it sound like a lot of work!

So, what I'd rather see is something like this:


Would this be possible??

Erik

1 comment

Hello Erik,

Please try a more recent EAP build.
(the latest, #7041 has a 'quirky' facet dialog, but it still works)

I think most (all?) of your wishes will be fulfilled :)
At least, IDEA now runs a live template upon injection, so you can choose
type.

As for the field, there's an built-in intention to create+assign a field
from a setter method.

Again, please try #7041, and provide more feedback here!

-tt


0

Please sign in to leave a comment.