[Lazarus] Frontend lazarus with remote comunication through cgi

Michael Van Canneyt michael at freepascal.org
Sun Apr 4 12:09:20 CEST 2010



On Sat, 3 Apr 2010, Khaoz wrote:

> Hi.
>
> As a introduction, i'm a 11 years delphi developer, working with java
> and soa actually. Nice to meet you :)
>
> I'm planning to write an application which will do all business logic
> and database comunication on a remote server.
>
> I want to use lazarus to write the frontend (java is to slow) and
> backend (cgi) and the primary objectives are:
>
> 1) On the client side i want only to have the forms (and validations),
> maybe some dto (data transfer object) or model class (extended from
> tcollection and tcollectionitem) to send/get data to the web server.
> 2) On the server side receive/send the data and do updates, inserts,
> validations... etc...
>
> The initial solution come from this blog post
> http://leonardorame.blogspot.com/2009_03_01_archive.html, and i have
> some questions for more experieced lazarus developers:
>
> 1) Its possible to do the persistence with tcollection and
> tcollectionitem as described on the blog above through http/https ?

Yes. I would suggest using synapse, it is more lightweight than Indy.
For the server, you may want to look at using fastcgi, it is more efficient.

> 2) Is there some edit component/form to bind a tcollectiontem to form edits ?

Yes, there are 2 possibilities:
1. you can use RTTIcontrols, they are included in Lazarus.
    I once wrote an article on how to do this.
2. You can use tiOPF. This is more powerful than RTTIControls
    (it is a full object persistence framework), but has a much
    bigger learning curve.

> 3) Is there some grid component which can be filled with a tcollection.

Not as such, but the 2 options mentioned above will show you how to do this
easily.

> 4) Use tcollection and tcollectionitem is a good idead or use some
> orm/dataset tools is better ?

I use collections all the time, they are easy to use.

> 5) Have you made something similar and can point me to a better solution ?

See the answer on question 2, tiOPF.

You could also try PressObjects, which is an alternative to tiOPF.

Although I think that tiOPF is more mature, simply because it exists
much longer and has been thoroughly tested.

Michael.




More information about the Lazarus mailing list