Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-04

Frontend lazarus with remote comunication through cgi

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Khaoz

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 ?
2) Is there some edit component/form to bind a tcollectiontem to form edits ?
3) Is there some grid component which can be filled with a tcollection.
4) Use tcollection and tcollectionitem is a good idead or use some orm/dataset tools is better ?
5) Have you made something similar and can point me to a better solution ?

My app will start little but will grow a lot (i know because it's a rewrite of a existent one) and i want to be certain about some choices.

Ty and sry for my bad english. It's not my native language.

Giuliani D. Sanches twitter.com/giulianisanches giulianisanches.blogspot.com Como elaborar uma pergunta: http://www.istf.com.br/perguntas/

Reply by email

Michael Van Canneyt
to Khaoz
Khaoz wrote 23 lines
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.

Reply by email

Héctor Fiandor Rosario
to Michael Van Canneyt

Dear Mr. Michael:

where can I obtain the article you have wrote?

thanks in advance,

yours truly,

Ing. H?ctor F. Fiandor

Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas Infomed: http://www.sld.cu/

Reply by email

Michael Schnell
to Khaoz: Hi. As a introduction, i'm a 11 years delphi developer, working with java and soa…
Khaoz wrote 6 lines
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...

What we did (using Delphi instead of Lazarus on the Server site and Flash "Action Script" instead of Java script on the client site, but this should not make a huge difference) is:
- Use SOAP as the communication protocol
- Action Script already provides most of the SOAP protocol
- use IIS with ISAPI CGI - API
- Use Remobjects on the server site to do a very simple the ISAPI dll ("Gateway") and have it do the SOAP protocol
- Do a normal application for the business logic
- Use Remobjects' propriety protocol on windows messages to have same communicate with the ISAPI dll

Of course you would need to buy RemOBJ for this (AFAIK, RemOBJ now does support Free Pascal, Lazarus support is not strictly necessary).

If you want to avoid any part of the logic at the client site you could try ExtP / ExtPascal / ExtJS that works with a standard Java Script Framework to create a HTTP "Remote GUI" for Lazarus Programs. This does seem to work fine, but I suppose ("realtime") notifications from the business logic towards the Client (aka "Comet") are not yet fully supported. I learned that ExtJS does provide this, so the Pascal part should be doable on top of this.

-Michael

Reply by email