Java Reflection and the pain in Refactoring

后端 未结 9 1650
清歌不尽
清歌不尽 2021-02-08 14:25

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!

Ther

9条回答
  •  不思量自难忘°
    2021-02-08 15:21

    You can avoid writing reflection API with dp4j.com when you know at compile time what you are looking for.

    About xml mappings, they are a pain, I also experienced with NetBeans Platform and less so with JPA2. The good news is that annotations are taking over, and this offers again compile-time checking. I'm not sure about Hibernate, but both JPA and NetBeans (more as of 7) offer annotation equivalents of xml mappings.

    I had also developed SqlWrapper to get away from using strings with JDBC. More sophisticated (and complicated) is JPA2's criteria API.

提交回复
热议问题