locked
Service inheritance RRS feed

  • Question

  • Hallo *,

    i have a question about how can i add expand a service. Like inhertiance in a object-oriented language.
    I created two services with DsspNewService tool named Service_one, Service_two. In the Service_two i changed the line:
    Code Snippet

    public class Service_twoService : DsspServiceBase


    to
    Code Snippet

    public class Service_twoService : Service_oneService


    but if i try to read some values defined in Service_one i got an compiler error:
    Error    1    'Service_twoState' does not contain a definition for 'Ticks'
    The Ticks property is defined in Service_one.

    How can i inherit from another service?

    Thanks, 

    nanostruct

    p.s. sorry for my bad english
    Saturday, June 9, 2007 12:40 PM

Answers

  • We actually dont support inheritence in this sense. Services are isolated from each other. Instead, we can do similar extension, by partnering: In service 2, Partner wth service 1, and issue requests to it. When other services no talk to your Service 2, you can respond using the data you got from service 1, without them knowing.

     

    In the more traditional OO sense, you can indeed inherit the *state* type of service 1, in your service 2. So when other services do GET on Service 2, they see an extension of the Service1 data state. But you will still have to send messages to 1, under the covers, in your service 2

     

    In this DSS subforum, search for Alternate Contract, Alternate Port, etc since that is our primary mechanism for extension, "inheritance"

    Tuesday, June 12, 2007 4:09 PM
  • This thread describes alternate contracts and ports:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1382375&SiteID=1

    Wednesday, June 27, 2007 5:52 PM

All replies

  • We actually dont support inheritence in this sense. Services are isolated from each other. Instead, we can do similar extension, by partnering: In service 2, Partner wth service 1, and issue requests to it. When other services no talk to your Service 2, you can respond using the data you got from service 1, without them knowing.

     

    In the more traditional OO sense, you can indeed inherit the *state* type of service 1, in your service 2. So when other services do GET on Service 2, they see an extension of the Service1 data state. But you will still have to send messages to 1, under the covers, in your service 2

     

    In this DSS subforum, search for Alternate Contract, Alternate Port, etc since that is our primary mechanism for extension, "inheritance"

    Tuesday, June 12, 2007 4:09 PM
  • Is there something like tutorial how to use AlternateContaracts & AlternatePorts?


    cu nanostruct
    Thursday, June 14, 2007 9:53 PM
  • there is a good post from david lee, in this sub forum, on alternate contracts. Also search our sample source for [AlternateContract to see all the services that implement them.

     

    our upcoming Dss user guide will have more documentation as well

    Friday, June 22, 2007 3:00 AM
  • This thread describes alternate contracts and ports:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1382375&SiteID=1

    Wednesday, June 27, 2007 5:52 PM