Short forum post on REST API

Nick Sabalausky a at a.a
Sat Apr 2 00:06:43 PDT 2011


"Adam D. Ruppe" <destructionator at gmail.com> wrote in message 
news:in63uu$b41$1 at digitalmars.com...
>I just quickly wrote this up describing an idea I had earlier
> today on combining rest api calls (example: foo(bar(10)) should be
> just one call to the server) on a little forum I post to:
>
> http://www.sveit.com/forum/viewtopic.php?f=11&t=3364
>
> It's not really D specific, but I used D as my language to discuss
> the idea, so I figured I'd share it here too. A lot of people I
> talk to are surprised that I've been using D2 to write professional
> websites and client apps alike for the last year, so I plan to write
> more posts like this to explain how I'm doing things.
>

Nice, common-sense-driven design strategy. Not enterprisey at all.  I like 
it :)  And it doesn't toss yet another layer on top the mess of 100 
poorly-designed layers that the (aptly named) web is already 
made^H^H^H^Hhacked together with.

A few minor typos:

ApiValue!int sueFunction(int a, int b); // <-- I doubt it's really a 
litigation function

umberToString  // <-- Funny, but probably not accurate

My only concern is how much can multiply-nested calls balloon the query 
string, and can that be an issue? And what about the feasability of 
something like this: foo(bar() + 2)

> Like with this, a lot of the ideas are things that /could/ be done
> in Javascript, PHP, etc., but it's never as elegant, or IMO as obvious,
> to do as it is in D.

The only way to make *anything* clean or elegant in JS or PHP is to not use 
them at all and say you did ;) Well, either that or a change in perspective 
via self-inflicted brain damage, but I prefer the former.




More information about the Digitalmars-d-announce mailing list