C# Interfaces

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nando

    #1

    C# Interfaces

    I have set of objects working together in the classic client-server way.
    The server in other to do its work requieres the clients to implement an
    interface.

    However the client objects perform several tasks in other components of the
    program and the use of those interface methods outside the server is not
    appropiate, is it posible to hide the interface implementation to objects
    other than the server object?

    Thanks in advance,

    Atte:
    Nando


  • Dmitriy Lapshin [C# / .NET MVP]

    #2
    Re: C# Interfaces

    Hi,
    [color=blue]
    > The server in other to do its work requieres the clients to implement an
    > interface.[/color]

    Sounds a little bit strange until the server needs to call back the clients.
    [color=blue]
    > However the client objects perform several tasks in other components of[/color]
    the[color=blue]
    > program and the use of those interface methods outside the server is not
    > appropiate, is it posible to hide the interface implementation to objects
    > other than the server object?[/color]

    You can declare an interface containing all the methods expected by the
    server. The client classes will implement this interface, and the server
    class will be talking to the client classes only through the interface
    declared. The rest of the methods in the client classes can be declared as
    internal and therefore won't be visible outside the assembly containing the
    client classes.

    --
    Dmitriy Lapshin [C# / .NET MVP]
    X-Unity Test Studio

    Bring the power of unit testing to VS .NET IDE

    "Nando" <xnandox@hotmai l.com> wrote in message
    news:OBcvzfGlDH A.2424@TK2MSFTN GP10.phx.gbl...[color=blue]
    > I have set of objects working together in the classic client-server way.
    > The server in other to do its work requieres the clients to implement an
    > interface.
    >
    > However the client objects perform several tasks in other components of[/color]
    the[color=blue]
    > program and the use of those interface methods outside the server is not
    > appropiate, is it posible to hide the interface implementation to objects
    > other than the server object?
    >
    > Thanks in advance,
    >
    > Atte:
    > Nando
    >
    >[/color]

    Comment

    Working...