CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Posts
    384

    Question on Interface

    Hi,

    Can you please help interpret the following statement with respect to C# ?

    [Code]
    All objects must expose some dynamic interface discovery mechanism so consumer components can, if they desire, access their "extended" interfaces.
    [\Code]

    I am not very clear with regard to what the author is trying to say with regard to dynamic interface discovery mechanism here - can someone please explain ?

  2. #2
    Join Date
    Jun 2001
    Location
    Melbourne/Aus (C# .Net 4.0)
    Posts
    686

    Re: Question on Interface

    I believe it means that an object (A) must supply a mechanism that allows other objects (B,C,D... etc) to detemine what the object (A) provides.

    In other words, other objects (B,C,D... etc) must be able to enumerate the methods/properties etc in the original object (A).
    Rob
    -
    Ohhhhh.... Old McDonald was dyslexic, E O I O EEEEEEEEEE.......

  3. #3
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Question on Interface

    It seems like it talks about COM which has other approach to interfaces than C#.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  4. #4
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: Question on Interface

    All objects must expose some dynamic interface discovery mechanism so consumer components can, if they desire, access their "extended" interfaces.
    If this really is .NET, then you get all this for free as part of the language.

    You've got the 'is' keyword (or 'as' and test for null) which tests if an object implements a particular interface (amongst other things).

    You can also use reflection to determine if a type implements a particular method.

    Darwen.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

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

Featured