[jboss-as7-dev] RESTishness (Was Re: Management Console JDK Server Example)
Jason T. Greene
jason.greene at redhat.com
Thu Jan 20 13:43:05 EST 2011
On 1/20/11 11:00 AM, Heiko Braun wrote:
>
>> REST frameworks like JAX-RS bring little value to our JSON/HTTP API,
>> since it is just a wrapper of the underlying binary detyped DMR
>> protocol. Even if we did use a framework we would still have to write
>> the marshaling bits, which is the majority of the implementation.
>>
>
> Good point. The question is if we are building a JSON RPC protocol over
> HTTP or a REST interface.
> The later requires some more bells and whistles. If we simply need an
> HTTP access point to handle a JSON'ish RPC
> protocol, then the embedded HTTPD might be sufficient.
>
> I don't want to start a religious war over what REST actually means, but
> we would at least need to consider things like
> content negotiation, uniform interface constraints, etc. Typical reasons
> to build a RESTful interface in the first place.
>
> But let's move this to a separate thread.
Yeah this is something that comes up so often, some of us have started
to avoid using the term REST. In fact from now on I will no longer use
the term.
The original requirement for the "REST" protocol is to allow scripting
languages easy remote access to our Domain APIs. The domain APIs are RPC
in nature, so this really means RPC over HTTP. Doing a pure "REST"
architecture doesn't really add much to achieving this client, but
certainly adds a number of drawbacks. We would end up having to store a
large amount of transient state on the server just to make things that
are not resources look like resources. As an example we have the notion
of a deployment plan, which is a set of operations that are supposed to
be applied atomically according to a policy. The best mapping for this
is to send the plan over an HTTP post. Such a thing is far easier then
coming up with a bunch of abstract resources, and numerous http requests
to interact with them.
--
Jason T. Greene
JBoss, a division of Red Hat
More information about the jboss-as7-dev
mailing list