xconns-com / go-router

Automatically exported from code.google.com/p/go-router
0 stars 0 forks source link

REST generalization #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,
Your project is quite interesting and match partially my needs which are to
make/use a REST server in Go...
It seems that your architecture could be widespread to the REST paradigm,
so my question is the following : if I send a GET/PUT/... HTTP request to a
URI defined in the router, may this request can be handle by this one?
If so, we could add some RESt feature easily it seems
regards
Xavier

Original issue reported on code.google.com by xavier.m...@gmail.com on 4 Jun 2010 at 8:11

GoogleCodeExporter commented 8 years ago
Hello,

Do we have two kinds of name-spaces? Here is my understanding, please correct 
me:
1. resource oriented: names/ids are used to identify resources (web URI or file 
system path names); then we have CRUD api for these identified resources 
(GET/PUT/..., or read/write/...)
2. call oriented: names/ids are for exported function names in RPC or message 
ids/tags/types in message passing; the api is call/reply or request/response.

If i understand you correctly, the REST server you mentioned is more in the 
first category, while "router" is in the 2nd. I am not sure if they are good 
fit or not.

stretch a little bit, maybe router can be used as the following?
1. as underlying communication: REST server can use ids in router for its 
operations: "Get"/"Put"/...; clients can bind to these ids and send msgs which 
contains URLs for objects to be manipulated.
2. use router ids' name-space for help: for each exposed resource A, server 
will define several ids: "A-Get"/"A-Put"/...; clients can have a proxy object 
for each resource exposing several methods Get/Put/..., which internally will 
translate operations to messages sent to server?

Regards
Yigong

Original comment by yigongli...@gmail.com on 16 Jun 2010 at 5:59