Results 1 to 15 of 15

Thread: reflection question [resolved]

  1. #1

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Resolved reflection question [resolved]

    hi,

    what is reflection???

    i have heard a lot about it, but have no idea what it actually is.
    Last edited by tr333; Feb 17th, 2005 at 11:04 PM.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: reflection question

    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  3. #3

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: reflection question

    i have read that before but i dont understand most of it.

    too technical and not enough plain english...

    not good for people new to .net
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  4. #4
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: reflection question

    Hi
    There are 2 samples reflexion in the vb.net codebank forum.

    http://www.vbforums.com/showthread.php?t=306850 http://www.vbforums.com/showthread.php?t=310409

    Regards
    Jorge
    "The dark side clouds everything. Impossible to see the future is."

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: reflection question

    Given a .NET assembly, you can use Reflection to access various methods, events, properties, etc. in it.

    There may be times where you need to use it. Recently, I was working on a testbed application tester which would be passed a .net assembly. I would run through it's methods, invoke them and get the results, comparing it with an existing 'result' file.

    Never finished it, but without reflection it wouldn't have been possible.

  6. #6

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: reflection question

    i understand some of the things that can be done using reflection, but i still dont fully understand the definition of reflection.

    from MSDN:
    provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types
    can someone please explain this statement in words that are easy to understand for someone new to .NET
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: reflection question

    It means:

    If you look at my example in the link above, the Reflection namespace allows me to iterate through the objects and properties, etc. of the class. Also, I could use the InvokeMethod() object and pass it a name, it would invoke that method.

  8. #8

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: reflection question

    whats invoking a method mean?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: reflection question

    Calling a method.

  10. #10

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: reflection question

    is a method just another name for a function/subroutine?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  11. #11
    Frenzied Member Asgorath's Avatar
    Join Date
    Sep 2004
    Location
    Saturn
    Posts
    2,036

    Re: reflection question

    correct
    "The dark side clouds everything. Impossible to see the future is."

  12. #12

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: reflection question

    so i guess reflection is just a way to control other objects/methods and their properties
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  13. #13
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: reflection question

    It can be used for that. You can also create new instances of forms in other assemblies, for example.

    Here's another example of usage:

    http://msdn.microsoft.com/msdnmag/is...n/default.aspx

  14. #14
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: reflection question

    Hi,

    As I understand it, you can use Reflection to refer to objects, methods etc using a string, which can be provided by the user as well as in design view, rather than hardcoding in the actual name. You can do this in other ways as well, to a certain extent, e.g. CallByName or Arrays of objects, but Reflection provides a more flexible approach.

    CallByName and Arrays are easier to learn.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  15. #15

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: reflection question

    thanks for the help on this...
    nothing mission critical, but its nice to know.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width