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

  • SEARCH
  • Home
  • 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 8988271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:58:56+00:00 2026-06-15T21:58:56+00:00

I have been advised to refrain usage of Reflection. I really wanted to know,

  • 0

I have been advised to refrain usage of Reflection. I really wanted to know, is it because Reflection is expensive? If not what is the reason to avoid using it?

My current and future projects might as well need to access any given class – members information. As I some times need to list fields & Properties – values or declaration name.

So What I would like to know, is:

How does Reflection work? How does it get to the information? (a short explanation will do)

And why it’s not so recommended to use the reflection in application? If you do need to get required information being a field or properties values OR names, could you do it not by using System.Reflection?

Some background.

The usage in my current project(for example), is to list out a specific sql server table-columns names, or SQL – tables names .

I could think of other ways to have it returned as a List<strings>.

If I really knew why or how “bad” it is, to use reflection,

..I could then make a decision, if I really want to avoid it, as I might find an alternative approach (in this specific scenario).

Either by accessing database (not preferable) any time I need (say) list of tables names or I could do it once (access the data ), then store it in a text file or xml, if I really must avoid reflection.

I know of some even more elegant one, too. That’s not the issue though. (again this is only an example as there could be many other use cases, you probably know that. )

update

this Question was closed please help reopen it , and vote ‘reopen’ below

thanks .

  • 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-06-15T21:58:57+00:00Added an answer on June 15, 2026 at 9:58 pm

    A CLR assembly (executable or dynamic link library) typically contains metadata about its structure, which means information about the types, the structures, the methods, the fields, their names and a bunch of other information that, in “traditional” languages, were usually lost and replaced by offsets and size information only.

    Reflection is a powerful tool and some (usually advanced) things can only be achieved using reflection. However, it also raises concerns about security and encapsulation, because you start relying on the implementations of the parts of your program (or other programs), while you should generally avoid those and just trust the interface those parts give. Another concern is performance, because to access all this kind of (ultimately textual) information, the program is slowed down, in contrast to using the non-reflective approaches (which usually still use offset and size information). For instance, you could re-implement polymorphism using reflection and bypass the virtual method table. But the latter is many times faster than the former.

    Use reflection if you have to, but don’t use it if you don’t have to. It’s one of those tools that are very powerful and people advise against using them, but you may use them if you really know what you’re doing. That being said, please keep in mind that using reflection techniques in a wrong manner does not only raise the above issues, but tends to make your code significantly harder to maintain as well.

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

Sidebar

Related Questions

I have been using TortoiseSVN for some time and I really like it. I
I have been advised here not to create a single page website. However, I
I have tried using (and have been advised against) using regular expressions for this
Designing an interface with QT4 I have been advised that using multiple Tabs at
As a newbie, I have been advised to preferably use heredoc compared to too
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
I have been tracking emails for years using a "beacon" image and for those
I am moving hosts and i have been advised to set up a redirect
I have been advised to use the following options with GCC, as it helps
I have been advised that having expose_php = On in my php.ini is a

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.