Hi Jens,
below my opinionated view on the matter.
Am 08.02.2013 23:01, schrieb Jens Kristian Jensen:
>
> Thanks for the answer
>
> On C implementations:
> I use libwebsockets as raw WS library, which in turn uses
Depending on your needs, you might also be interested in
https://github.com/zaphoyd/websocketpp
which is an ASIO based C++ WebSocket implementation that has 100% test
coverage via AutobahnTestsuite.
>
> On mapping RPC URIs to proxy objects
> True, it does not have to be of the protocol itself. But then there has
> to be a common understanding to ensure than the URIs constituting and
> object in, say, AutobahnPython server and a client implementation made
Parts of a distributed application always need some "understanding" of
each other. And this doesn't stop at the syntactic level of some
interface, but necessarily extends to the semantics of the interface as
well. I have yet to see an IDL that describes the semantics of an API.
For if you have an IDL that unambiguously and completely describes an
interface syntax _and_ semantics, that interface spec would be
"executable" in some interpreter .. and hence already constitute an
implementation of the component.
> in another language. Is there more to the WAMP spec than what I already
> read? The proxy objects would be more than just a convenience IMO - also
> a way to say "there return value you get here is really a reference to
> an object, which has these methods". It provides an easier way to
A RPC with WAMP calls a remote _procedure_, not a method on a specific
object of some instantiated class. This is not CORBA. Deliberately.
There are no protocol means to instantiate a server-side object for
client use. The server-side implementation might of course have a
session specific object instantiated providing the endpoint
implementation .. or it might be a singleton .. or whatever. Thats
hidden from the client.
> document an interface and provides structure to the API in a way similar
> to classes and methods vs. flat function calls.
>
> On IDLs:
> For me they are at least of the following use:
>
> * Checking that a client and a server speaks the same language (same
> interface, version, etc.)
Interface versioning (CORBA/DCOM land) introduces coupling .. WAMP is
all about simple, adaptive, dynamically typed interfaces ..
What do you do if you have deployed 100s of your embedded devices and
now want to extend an interface, say add some attribute to a return
value? Your statically generated stubs will break. You need to have a
new interface version. Complexity, brittleness arises ..
> * A way to generate client/server stubs in languages like C++ - the "old
> school way" as you said.
Supporting statically typed languages can be done by molding i.e. RPC
return values into the concrete implementation type .. skipping i.e.
attributes unknown by the implementation. This is how AutobahnAndroid
works .. via the magic provided by Jackson.
Of course that relies upon reflection capabilities of Java .. but C++ is
catching up, and using i.e.
https://bitbucket.org/dwilliamson/clreflect
it should be possible to replicate this approach.
Yes, this is different from having a separate IDL and generating
stubs/proxies ..
> * A way to help document your interfaces
This is a valid point .. we need something here.
I'd differentiate between:
a. documentation
b. validation
c. code generation (stubs/proxies)
IDLs and schema languages are for c. and b.. IMHO b. should be done on
app code, since you can't possibly specify all constraints via a schema
language anyway (unless you make it a full featured programming lang.)
> * Can be used as a way to interrogate a server about its provided
> interface. This way you can make a generic tool for inspecting or
> calling any server's interface, like e.g. D-Feet for DBus (
>
https://live.gnome.org/DFeet/ ). Currently I cannot see a way to do that
> with WAMP, at least not with the raw protocol. If I'm mistaken, please
> educate me.
With WAMP Challenge-Response Authentication, the client already gets a
list of RPC endpoint URIs (and PubSub topics) he is authorized to use.
WAMP-CRA is implemented on top of 2 predefined RPCs
http://api.wamp.ws/procedure#authreq
http://api.wamp.ws/procedure#auth
This could be extended by providing a reflection API:
http://api.wamp.ws/procedure#describeProcedure
http://api.wamp.ws/procedure#describeTopic
This should at least include developer documentation for the parameters
and return values.
We could of course invent something along
http://json-schema.org/
http://tools.ietf.org/html/draft-zyp-json-schema-04
and return respective machine readable data with "describeProcedure".
This could be then used for validation and/or stub generation.
However, I don't believe in schemas for validation ..
Take the example here:
http://json-schema.org/example1.html
What if I want tags to follow some regular expression, but only if the
user is not admin?
What if I want the minimum allowed product price to depend to on product
category?
In any case: there is no need to extend the _wire protocol_.
If you want to further discuss the "describeProcedure/Topic" approach
above, I have created an issue for WAMPv2
https://github.com/tavendo/wamp/issues/22
Your opinions/ideas are welcome!
-- Tobias
>
> Thanks for WAMP and the interesting pointers to C++ reflection.
>