Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if not possible then its fine , as someone has asked me i said the same thing in interview.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic