| Author |
BeanFactory Return Class Rather Than Object
|
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15229
|
|
I asked this on the official Spring forums as well so if I get an answer there I will update this thread. I am using Spring in a desktop application and I have the following class: To use this I do the following: Is there anyway to genericize this so that I don't have to cast? Obviously casting is not a big deal. I'm just looking around for minor improvements to my code. Thanks.
|
 |
Sergey Chunayev
Greenhorn
Joined: Jan 24, 2008
Posts: 6
|
|
You can try to do a trick with templates in your DataAccessContext: At least, with this solution you don't need casting when invoke this method.
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15229
|
|
Sergey, Thanks. That is pretty slick. As you said, at least it saves me the cast. One less thing I have to type. Thanks again.
|
 |
 |
|
|
subject: BeanFactory Return Class Rather Than Object
|
|
|