Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:22:25+00:00 2026-05-15T23:22:25+00:00

Java’s reflection API is obviously a very powerful tool, but not particularly object-oriented. What

  • 0

Java’s reflection API is obviously a very powerful tool, but not particularly object-oriented. What are some situations where it is appropriate (and conversely, inappropriate) to use reflection?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:22:25+00:00Added an answer on May 15, 2026 at 11:22 pm

    In my opinion…

    Appropriate (clean):

    • Instantiating root of a dynamically-loaded implementation, such as an applet.
    • Use of Proxy to create a proxy or a mock implementation (may be better at compile time).
    • Implementing interpreters that allow unrestricted access to the Java libraries. (Note, from a security perspective the interpreted code now has the effective privileges as the interpreter – can be kind of dangerous.)

    Appropriate hacks:

    • Circumventing Java language access controls in third party code where you absolutely have to.
    • Implementing a “cross-cutting concern” such as persistence.
    • Removing static dependencies that load classes causing slower start up.

    Inappropriate:

    • General circumventing Java language access controls (includes testing).
    • Anything the relies upon Java language access rights given by the particular reflection-calling class.
    • Anywhere where implementing an interface would work.

    Generally reflection is much easier than generating source which is much easier than creating bytecode.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Java doesn't support multiple inheritance for abstract classes, but I'm trying to do the
Java, how do I create a hash map outside of main but refer to
Java design question. I have an object that needs to maintain sets of say
Java Code : DOMConfigurator.configureAndWatch(log4jConfigFile.getAbsolutePath(),100000L); I need to add some appenders programmaticaly whenever Thread created
Java Exception: http://hastebin.com/yiwecefifi.avrasm I have an object, that I call Category, that my fragment
Java. I have a very small int array (4 elements). What's the fastest way
Java fb API I am creating facebook web application, to create even following is
Java was claimed to be Once write, execute everywhere, but I wonder is it
java.util.concurrent API provides a class called as Lock , which would basically serialize the
java.lang.IllegalArgumentException: column 'data3' does not exist whats with data3 column?? LogCat 03-24 07:05:36.091: ERROR/AndroidRuntime(2540):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.