Re: DXS REST Proposal



У Ндл, 2005-09-11 у 16:21 +0100, Jon Wood пише:

> I was told that the current proposal is to use SOAP for this, however
> SOAP tends to be have a lot more bloat than neccesary for the
> requirements.

To use SOAP was my idea, so i should write a little bit about why i was
proposing it.
This XML (REST) Idea is not bad. After all discussion i am thinking that
it dont have much matter what technology would be used. We have
something what work, and what it is - no matter. So if somebody start do
implementation - its already good enough.

Why i still prefer SOAP - there is no need for writing libs. At this
moment many languages understand SOAP natively (php,perl,mono,java,c/c
++).

Second is, you define whole stuctures of data on server side. And it can
be fast updated with WSDL for programmer.
There are Namespaces to place all on their places.
Its easier for client to handle SOAP, than to parse XML.

> I have written a proposal on using a simpler system based on HTTP
> GET/POST requests, which return the data in a much smaller, more
> readable, format. This makes it a lot easier to debug, and reduces the
> ammount of bandwidth required.

SOAP is POST request too. But client or server side do not care about
communication.
How much bandwidth would SOAP need vs. REST? Not much. Request would be
definitively bigger, but result would not relatively much bigger. SOAP
is about some bytes more per Request/Answer than REST.

Debug.
Its very easy to debug SOAP, there is already Error Handling build in.
Server can send client some error( or even) debug data. You can handle
it on client side.
On server side there is "php-log" class, which can save error messages
to DB, file, or Syslog. So there is no really troubles with it.
I already done initial work for backgrounds. It was very easy.
Unfortunately it don't work at this time properly, because i think DB
layout is little bit different to latest i was used.

> While it will require writing libraries to process the information, I
> believe this will take less time in the long term than using SOAP.

I wouldn't so sure. First - nobody will have new library. Second, its
not as long to take SOAP work as here is described. You can build simple
SOAP service with client in 5 min.

> You can find the proposal at http://wiki.jellybob.co.uk/dxs 

Here is how SOAP code looks on server side:
http://dxs-project.org/moin.cgi/ServerExample

For every class we need must be one Class (Backgrounds, Icons, GTK,
GamesStuff, etc).
This is example how Backgrounds Class should look. There is constructor,
wich deskribes which methods are on the service usable and which complex
types we have. There are also two methods:
	function getItem($id)
and
	function getItems($xpath,$startpos,$count,$temp)

whey connect DB server and ask for needed data, than transmit it as
array, or one object to the client. So client side just make new
instance of the items, and allready can use it.

There are any other things to do:
1. Design whole server/client communication to reduce count on requests.
We need ideas about caching, what client should ask and how.
2. Make Service more bunle to web-page, so if somebody change DB layout
it would be no need to rewrite something in web-service.

-- 
Kulyk Nazar aka tirpse




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]