0
votes

I am really a beginner in delphi, as the client request the project to be done in delphi, so I have to ask to get some help as possible as I can. This project will be involved in HTML5 and websockets as well, so there are some questions I need your advices.

Sorry let me explain more, this application have two parts mainly, one is HTML5 client web app (this app will be loaded from web server, and run locally in browser), and the other is its service located in server. The HTML5 web app is doing some product editing job, as well send its final output to server, during this process, there will be many communications between client app and service, and I planed to use Websockets.

I did plan this application in HTML5 and Node.js before, but as client send request to ask for the Delphi XE as primary development tool also it will be compiled to DLL (ISAPI, have to be) at last. For consistency of UI, I also was required to use uniGUI (http://www.unigui.com/demo)for Delphi. Now I have these questions:

  1. Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?
  2. What good libraries support Websockets in Delphi?
  3. What book you can recommend me to read, as I don't know Delphi at all.

Thanks.

2
What type of project is it? What's "browser-server"? Please ask one question at a time, and 2 and 3 are not proper questions for SO.Marcus Adams
Do you have to create HTML5 javascript application? But you use delphi object pascal and perform crosscompilation from delphi_to_html5 app? Or you must embed html canvas into standalone Delphi win application?Whome
By "browser-server" you mean an embedded browser or a webserver? An embedded browser is a browser control that shows an HTML page inside your application, a webserver is an (S)HTML provider which can be reachable trough the network/internet.mg30rg
Thanks for all. I added some explanation, the application is a Web app + Server service, sorry for confusion as I didn't know Delphi at all.Tom
first of all: yes. unigui is by no means required. you can write your gui in js (angular perhaps) and use delphi for only a web service provider, either standalone service on some port or ISAPI dll. There are many ways to provide that web service too: you could use DATASNAP, or you could one of the many WebSocket implementations, you could use a Indy server, you could use a mORMot server... As I said, many options. Personally I'd stay away from unigui, datasnap (stability etc). any of the others is good.Tuncay Göncüoğlu

2 Answers

1
votes

Is there any other way to do this application with HTML5 as web front exclude uniGUI in Delphi?

First concept : HTML5 applications are a bunch of HTML files and JS's wich can be processed by browsers.

Second concept : You need an application that can bind HTTP queries and return files from the first concept.

Third concept (paradigm) : With first two concepts, a third concept arises. Dynamic HTML. What is dynamic HTML? HTML that generates at runtime at the backend server and/or at frontend with JS.

Solution :

Yes, with Delphi as a backend server you can manipulate and return HTML5 views, if you know (MVC paradigmn for example) you can program an HTTPServer application that binds HTTP request from network and responses your HTMLs and JS.

What good libraries support Websockets in Delphi?

You need a multilayer library. The best library I know is mORMot. mORMot is like a swiss razor for Object Pascal. You can create an HTTP server with websocket published interfaces. mORMot's Site

What book you can recommend me to read, as I don't know Delphi at all.

I have more than 10 years with Delphi and Free Pascal and I didn't read a book at all. But I read a lot from internet and a lot of computer architecture and another languages like C and C++.

If you like Delphi there are tons of documentation via Internet. I cannot recomend you a book because I will lie you.

0
votes

1: yes, make a "single page app" (static html + js) and communicate with server using xml or json. At least with indy 10 it is quite straight forward to implement static file serving (response.contentstream := tfilestream.create(sfilename) or something like that)

2: yes, if you search for it on google you will find some :) WebSocket server implementations for Delphi

btw, I'm busy with delphi socket.io implementation, which makes it easier to use websockets instead of plain low level tcp-like websockets itself