On Wed, Apr 4, 2012 at 12:21 PM, Kees Bos <[email protected]> wrote:
> Synchronous http calls (or json over http) are simply not possible in
> javascript (i.e. in browsers).
that's not quiiite true: the AJAX load function takes a parameter
true/false which is very rarely used.
the reason why it is very rarely used is because:
1) the browser is completely unresponsive - locked up solid - until a
response is received
2) there are usually only two outstanding HTTP connections allowed at
any one time by a web browser engine, in order to prevent overload of
web servers.
if you attempt to make several synchronous HTTP requests you are
therefore in for a bit of a shock. in fact, if you make *any*
application that uses a synchronous design, its performance will be
similarly affected.
overall, then, it's very simple: the desktop application, by using
synchronous function calls, was extremely badly designed i.e. was
subject to delays and lock-ups.
by subdividing the application along *proper* asynchronous
event-driven MVC lines, you can split the back-end ("M") into a
JSONRPC service and leave the V and C to operate at the front-end, and
the UI will be properly responsive and not subject to delays or
lock-ups.
l.