This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori 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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 17276
    
    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 - iOS Apps
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Modify Constructor Argument in Construction injuction in spring POJO withou modify java.
 
It's not a secret anymore!