locked
Generic Service Confusion RRS feed

  • Question

  • There's something that I don't understand about shared contracts and generic services. When I'm coding to a generic service - say something like the generic differential drive service - I can configure it with a manifest for specific hardware or simulation. For example, I can write code in VPL that uses the Generic Differential Drive and then later hook it up to a Lego bot or an iRobot Create, etc.

     

    I tried to do something similar to this by creating a contract and two services that implement it. Similar to the DSS tutorial #8 and #9, but I created two services (call them A and B) based on the generic service contract. Now, should I be able to interchange configuration so that I can make the code use A or B based soley on configuration? I can't seem to get this to work.

     

    Essentially I want to represent a generic piece of hardware in my code, and be able to change configuration to attach to specific hardware without having to interchange shapes in the VPL.

     

    I hope this explanation makes sense, and I hope someone can help.

     

    Thanks,

    ChuckMoose

    Friday, April 25, 2008 1:23 AM

Answers

  • I have it working now. I was only able to configure the generic contract with one of the service implementations. It turns out that they had mismatched values for AllowMultipleInstances on the service ports - one was true tot other false. I fixed that and now i can configre my generic service to be either of the concrete implementations.

    Saturday, April 26, 2008 3:41 AM

All replies

  • Based on what you describe, it should definitely work. For example, I've written a "Generic Brick" service for small two-wheeled robots. Based on that I created implementation services for the Hemisson and Integrator robots, which are quite different. Both of them work fine and can be accessed via a "Generic Brick Test" program that only knows about the generic brick contract.

     

    Without seeing your implementation it is hard to tell if you have made a mistake. When you say that it does not work, can you explain what happens?

     

    Trevor

     

    Friday, April 25, 2008 7:28 AM
  • I have it working now. I was only able to configure the generic contract with one of the service implementations. It turns out that they had mismatched values for AllowMultipleInstances on the service ports - one was true tot other false. I fixed that and now i can configre my generic service to be either of the concrete implementations.

    Saturday, April 26, 2008 3:41 AM