hello,
I want to send data and a capability description to a remote site. Upon receiving the data at the remote site, I want to look at the description and create an object (via a factory method ) doing exactly what I want when I invoke exec on it.
Examples:
1) send [3, (add 5) ] => receive(obj); obj->exec() -> 8
2) send [3, (add -1, mult 2) ] => receive(obj); obj->exec() -> 4
I thought of having adder and multer classes in some form of multiple inheritance but could not figure out anything as this involves creating lots of classes from different permutations of capabilities. I think I'll need to learn something :) templates? My main concern is to have zero conditionals in the exec() function also easily add new capabilities.
thanks