Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Only exposing interfaces from the server

Only exposing interfaces from the server

Scheduled Pinned Locked Moved C#
databasedesignsysadminwindows-adminquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jwb77
    wrote on last edited by
    #1

    I have an IIS-managed server object, exposed to clients using a service/wellknown web.config entry. But I don't want clients to have to know the type of the object (currently defined in a shared library) -- rather I want them to just query for the interfaces they require. This would theoretically allow me to change the underlying type on the server without code changes on the client. To achieve this I wanted to expose the type as System.Object, but does not seem to be allowed by the remoting system. Have I made a design mistake? If so, what should I be doing? Jade Burton Programmer

    A A 2 Replies Last reply
    0
    • J jwb77

      I have an IIS-managed server object, exposed to clients using a service/wellknown web.config entry. But I don't want clients to have to know the type of the object (currently defined in a shared library) -- rather I want them to just query for the interfaces they require. This would theoretically allow me to change the underlying type on the server without code changes on the client. To achieve this I wanted to expose the type as System.Object, but does not seem to be allowed by the remoting system. Have I made a design mistake? If so, what should I be doing? Jade Burton Programmer

      A Offline
      A Offline
      Arjan Einbu
      wrote on last edited by
      #2

      You'll have to expose the object as atleast its interface. public IMyInterface GetIt() { return (IMyInterface)myObj; } where myObj is an object of any class that implements the IMyInterface interface

      1 Reply Last reply
      0
      • J jwb77

        I have an IIS-managed server object, exposed to clients using a service/wellknown web.config entry. But I don't want clients to have to know the type of the object (currently defined in a shared library) -- rather I want them to just query for the interfaces they require. This would theoretically allow me to change the underlying type on the server without code changes on the client. To achieve this I wanted to expose the type as System.Object, but does not seem to be allowed by the remoting system. Have I made a design mistake? If so, what should I be doing? Jade Burton Programmer

        A Offline
        A Offline
        Adam Turner
        wrote on last edited by
        #3

        You might be able to use internal on all other classes except your facades/interfaces. That should 'hide' those classes from all outside calls.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups