title: Java Reflection and the pain in Refactoring
body: <p>Java Reflection provides a mechanism to introspect an Object at runtime. No second thoughts, this is a great feature, but it breaks all the Refactoring conventions!</p>
  
  <p>There is no easy way (other than <code>File Search</code>) even in modern IDE's to know which attribute is referenced and where. This makes Refactorings much more complex (tiresome!) and error prone.</p>
  
  <p>To be frank, it's not just the <code>Reflection API</code>; <code>Hibernate mapping files (hbm.xml)</code> and <code>JSP files</code> both refer to the attributes as String and when you refactor your attribute name, then you have to manually change in all these places.</p>
  
  <p>Worse, the changes in Hibernate mapping files or JSP files result in runtime errors.</p>
  
  <p>I am interested in knowing how other programmers handle this in Java. Are there some tools? I use Eclipse/IBM RAD as main development platform. Normally we use a <code>constant</code> to define the attribute and use it whenever possible but its not always possible.</p>
  
  <p>I would also be interested how other languages handle this!</p>