0

我真的是delphi的初学者,因为客户要求在delphi中完成项目,所以我必须尽可能寻求帮助。这个项目也会涉及到 HTML5 和 websockets,所以有一些问题需要你的建议。

对不起让我再解释一下,这个应用程序主要有两个部分,一个是HTML5客户端Web应用程序(这个应用程序将从Web服务器加载,并在浏览器本地运行),另一个是它的服务位于服务器。HTML5 web app在做一些产品编辑工作,同时把它的最终输出发送到服务器,在这个过程中,client app和service之间会有很多通信,我打算使用websockets。

我之前确实在 HTML5 和 Node.js 中计划过这个应用程序,但是当客户端发送请求要求 Delphi XE 作为主要开发工具时,它最终也会被编译为 DLL(必须是 ISAPI)。为了 UI 的一致性,我还被要求为 Delphi 使用uniGUI ( http://www.unigui.com/demo )。现在我有这些问题:

  1. 有没有其他方法可以使用 HTML5 作为 Web 前端排除uniGUI来执行此应用程序Delphi
  2. Delphi中有哪些好的库支持Websockets?
  3. 你可以推荐我读什么书,因为我根本不了解 Delphi。

谢谢。

4

2 回答 2

1

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.

于 2017-07-03T09:14:52.550 回答
0

1:是的,制作一个“单页应用程序”(静态html + js)并使用xml或json与服务器通信。至少对于 indy 10,实现静态文件服务非常简单(response.contentstream := tfilestream.create(sfilename) 或类似的东西)

2:是的,如果你在谷歌上搜索,你会发现一些 :) Delphi 的 WebSocket 服务器实现

顺便说一句,我正忙于 delphi socket.io 的实现,这使得使用 websockets 而不是普通的低级 tcp-like websockets 本身更容易

于 2013-10-17T09:59:34.747 回答