[Gambas-user] Web application development

Benoit Minisini gambas at ...1...
Mon Oct 16 21:27:16 CEST 2006


On Monday 16 October 2006 00:40, Rob wrote:
> On Sunday 15 October 2006 15:52, Benoit Minisini wrote:
> > If you have comments, ideas, needs on how should work such a
> > component, tell now!
>
> As soon as I'm done with the project I've been working on all
> year, I intend to write a "gb.ajax" component that will let you
> take forms designed in the IDE and deploy them as web apps,
> generating the necessary XHTML and Javascript and faking the
> event loop through XMLHttpRequest and some kind of state
> preservation on the server side.  I'm sure there will be
> complications as I develop it, but after spending the last year
> and a half developing a gigantic Ajax app using nothing but
> perl's CGI module, Gambas forms parsed out into HTML, and
> handwritten Javascript, I think I'm ready ;)
>
> I know the aim of my component will be very different than yours
> (I don't intend to let the developer output HTML or Javascript
> code manually at all), but I'm curious as to whether you think
> it would make more sense as its own top level component or if it
> should hang off of gb.asp, or whatever you'll be calling your
> new component.  It seems to me that they're bound to have SOME
> functionality in common, though it's unclear how much.
>
> Rob
>

I'm not sure that it is a good idea to try to reuse directly GUI forms for 
making WEB forms. GUI controls are complicated, and usually do things 
differently from WEB controls.

I suggest making WEB controls only based on what is possible with HTML and 
JavaScript, without trying to behave exactly like GUI controls.

A WebForm would be a container for other WebContainers and WebControls. They 
will generate an HTML page that can be sent to the browser. WebControls could 
raise events to be catched in the server code, for example to get data like 
the TableView Data event, or events that comes from XmlHttp requests from the 
client (don't know at the moment).

The current gb.web component simplify the writing of CGI script by providing 
classes for request management, response generation, session management... 
See the svn repository for that.

I think you could based your gb.ajax component on gb.web, because having Ajax 
WebControls seems to be orthogonal to the management of HTTP requests and 
Session management.

Of course CGI may not be the right technology for that. But we can imagine a 
FastCGI component, that has all the simplicity of CGI without the need to 
launch a process for each request - even if launching a process on Linux is 
far lighter than on other OS. :-)

At the moment, session management is based on file saved by the CGI script 
into /tmp/gambas.$UID/session directory, and reloaded at each request. 

As Ajax applications seems to have to maintain a greater amount of data 
between request, maybe it is not the fastest technology. We could imagine a 
session server that store the data permanently, and give it on demand to the 
process that handle requests. 

Maybe a Ajax Gambas application could be an HTTP server on its own. It would 
be cool. I don't know if Apache (or other web servers) can automatically send 
an HTTP request to another port, where the Gambas server would listen.

What do you think about all that?

-- 
Benoit Minisini





More information about the User mailing list