[Lazarus] GUI development for web UI

Dariusz Mazur darekm at emadar.com
Wed Nov 24 16:42:36 CET 2010


  W dniu 2010-11-24 10:21, michael.vancanneyt at wisa.be pisze:
>
>
> On Wed, 24 Nov 2010, ik wrote:
>
>> Hello List,
>>
>> Well I know about the framework fur Javascript library in Lazarus, 
>> but I'm
>> thinking in the past year or so, what will it take to design a gui
>> application using Lazarus, and make it work like a web app that act 
>> the same
>> as the desktop version, without any specific components for it.
>>
>> Then today I found the following link:
>> http://blogs.gnome.org/alexl/2010/11/23/gtk3-vs-html5/ and it looks like
>> someone made something like that on GTK3.
>> The problem is that I do not have the time to do it myself (or I 
>> would have
>> created at least the start for it), what will it take to create 
>> something
>> like that for Lazarus that is not dependent on the widgets (it will 
>> not care
>> if it's GTK, Qt, WinAPI etc..), and take also 3rd party components 
>> for it ?
>
> You should first answer the question this man asks:
>
> "Now, I want to know, Is this useful?"
>
> The answer IMHO is: no.
>
> Each and every GUI or user action/change/whatnot will result in a 
> request from the browser to the webserver (with corresponding result 
> sent back), and will cause a lot of traffic.
>
> While this is fine and doable for small apps, it is not scalable at 
> all. If 100 users use your system, it will crash under the load (if 
> not earlier).

That's not true. Transfer every action to server is very simple task, 
and computing results also. Thus (on my web app) it took less than 10ms 
and every user very rare generate more actions than 1 per second. 
  Computing and sending pdf reports took much more (more than 90% of 
working time). As I observe two on core machine can work 100 users 
concurent without problem. With more can be problem, but  with memory.

> More to the point would be the morfik approach:
> - Design and code your app as you do now.

yes. I compile the same code for Web and desktop

> - Translate the lot to Javascript+HTML+CSS
nothing translate
every widget on form generate string consists several <div> and other 
html tokens
JS consists behaviour of widgets and communication API (rather consts)
CSS describe look of widgets

> Because then, the browser does all the GUI work, and only when 
> necessary (get
> data from server or store data on server) does the server get a request.
>
> I am building all blocks for the latter approach, but it is slow 
> progress.

My clients use it every day. Web has about 95% of usability of desktop. 
Today I prefer web approach, because its easy to make something 
beautiful (with CSS3  only several lines and widget get shadow, 
background , animations etc.






-- 
   Darek








More information about the Lazarus mailing list