This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Spring and the fly likes Modify Constructor Argument in Construction injuction in spring POJO withou modify java. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Modify Constructor Argument in Construction injuction in spring POJO withou modify java." Watch "Modify Constructor Argument in Construction injuction in spring POJO withou modify java." New topic
Author

Modify Constructor Argument in Construction injuction in spring POJO withou modify java.

Prabhat Ranjan
Ranch Hand

Joined: Oct 04, 2006
Posts: 397
In future customer don't want to compiling the java file , can we change the no of argument in Pojo class of spring.

i mean to say constructor injection argument can we modify without compiling the java class.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17271
    
    6

Prabhat Ranjan wrote:In future customer don't want to compiling the java file , can we change the no of argument in Pojo class of spring.

i mean to say constructor injection argument can we modify without compiling the java class.


You question isn't quite clear what you mean.

Regardless of Spring, if I have a class with a constructor that takes 2 arguments, and I want to change it to 3 arguments, then I have to change the Java code. Any change to Java code requires a recompile.

Now there are libraries like JavaAssist that can add code to classes at runtime.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Prabhat Ranjan
Ranch Hand

Joined: Oct 04, 2006
Posts: 397
if not possible then its fine , as someone has asked me i said the same thing in interview.
 
 
subject: Modify Constructor Argument in Construction injuction in spring POJO withou modify java.
 
It's not a secret anymore!