How To Implement Agnostic Machine Interface

I need to create a common interface to a machine. There are four different types of machines, and potentially multiple vendors for each machine/type. How would I go about creating this type of interface?

Thanks!
closed account (z05DSL3A)
What type of interface?
An interface to control the machines. For example the current machine type/vendor uses a socket connection and JSON-RPC, but another machine might require something different to perform the same functions. What I want to do is to be able to call a single, common method and then have the machine vendor/type implement it in its specific way. What I'm not sure of is how to do this, and what's the best approach to doing it (ABC etc?)
closed account (z05DSL3A)
I don't think I understand what you want but take a look at ACE[1] and TAO[2] in case I am anywhere near the mark.
_________________________________________________________
[1] http://en.wikipedia.org/wiki/Adaptive_Communication_Environment
[2] http://en.wikipedia.org/wiki/TAO_(software)
Sorry, guess I'm not explaining myself well enough.

Say you have two different types of vending machines. They both dispense items. But HOW they dispense them might be different. One of them might use JSON-RPC to vend the item, and the other could use a REST call.

So in the MachineInterface class, I'd want:

void dispenseItem()

In MachineTypeA class (Inherits from MachineInterface):

1
2
3
void dispenseItem() {
// Implement with JSON-RPC
}


and MachineTypeB class (Inherits from MachineInterface):

1
2
3
void dispenseItem() {
// Implement with REST
}


I guess my question is what's the best programming method to achieve this? Is it Abstract Base Classes? Template Classes? That sort of thing.

Thanks!
Topic archived. No new replies allowed.