[book promo] Reflection not part of OCP?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Congratulations on your latest OCP Study Guide! I'm thrilled that you both keep writing these excellent books.
I just learned about Java [1]Reflection in a Spring Boot course and was a bit shocked that I had never heard of Reflection. It seems quite an essential feature of Java.
I quickly checked the index of your two OCP11 Study Guides (must confess I've not managed to finish them yet) and did not find Reflection (or Introspection).
What is your view on Reflection not included in OCP? (or is it, and do I need to slap myself around with a copy of your OCP17 Study Guide?).
Sander
1. https://www.oracle.com/technical-resources/articles/java/javareflection.html
-
2 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
In my experience, reflection is not commonly used in professional software development, save a few special circumstances. Some examples include architecture code that process unknown classes, or even code generators. I’m not saying there’s not important use cases, but in my experience it’s not common. I think the only time I ever used it was to read annotation metadata.
Many people try to reflection to bypass access modifiers, like reading private fields, but that code may fail in production, as the security manager can block it. I’m not sure why you would need reflection for spring boot though.. there’s so many powerful things in spring boot already!
[OCP 21 Professional Study Guide] [OCP 17 Complete Study Guide] [OCP 17 Practice Tests] [OCP 11 Complete Study Guide] [OCP 11 Programmer I] [OCP 11 Programmer II] [OCP 11 Practice Tests] [OCA 8] [OCP 8] [OCP 8 Practice Tests Book] [Blog]
-
2 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Scott Selikoff wrote:
I’m not sure why you would need reflection for spring boot though.. there’s so many powerful things in spring boot already!
Ah, I've not properly expressed the reason for my question seeing your and Tim's reply :-)
It is not that I think anybody should use reflection, but that knowing the principle of reflection helps to understand how for example annotations work.
Similar to understanding the principle of Java bytecode - without the actuall need to write bytecode - helps to understand the compile and run processes of Java.
Thank you for your extensive answer!
Sander
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Driven Development | Test until the fear goes away
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Cooke wrote:Scott will keep me right on this, but I would view the Java Certs as an in depth examination on using the language constructs rather than digging into how things work behind the scenes.
Agreed. Language constructs and built in libraries. Also, the exam can't include everything. It contains a lot for a 90 minute exam as it is!
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
| A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |









