“当前”Delphi Web应用程序框架是什么?

17

我正在研究Delphi Web服务器应用程序,并且当我进入“新建项目”对话框时,我注意到有几个不同的框架可供选择。

WebBroker从概念上看最好,但是在文档中,它的DB和会话管理代码与BDE绑定在一起,这使得它在今天变得不那么有用。

WebSnap看起来非常相似,但文档说它已经被弃用,应该改用IW(“ VCL for the Web”)代替。

然后我看了一下IW,但实际上我无法理解它应该如何工作。示例代码中充满了像点击按钮触发事件处理程序以更改表单元素标题之类的桌面应用程序的内容。(如果我们要创建网页,那么这不是必须在客户端使用JavaScript完成吗?)

那么,在Delphi中构建Web服务器的当前标准框架是什么?


1
+1 非常好的问题,如果我没记错的话,IW会自动将Delphi代码转换为JavaScript并将其添加到HTML的<head>部分,但是我强烈建议采用不同的方法,也许使用IdHTTPServer(还不确定它的可扩展性如何...)和DWScript作为您的服务器端脚本语言?我已经多次使用这种方法,效果非常好。为了让您了解我的意思,请看一下一个非常古老的博客文章http://www.delphigeist.com/2010/12/dynamic-web-pages-with-dwscript-and.html - user497849
有趣,但那个例子只适用于提供页面。当您需要从用户获取数据并处理它时会发生什么? - Mason Wheeler
在GET/POST请求中,您可以处理数据,连接到数据库(如果需要),以及所有好的东西。例如,如果您需要为用户表处理数据,则可以拥有一个名为users.html的页面,该单元中的代码将负责插入/更新/删除/检索等操作。在这篇文章中,我没有添加这个示例,但是在开始定义DWScript中建立数据库连接和帮助您运行查询的类之前,这不应该花费您太长时间。 - user497849
因此,如果您定义了一个名为TQuery的自定义类,该类具有Execute | ExecSQL和Open方法以及一些检索字段值并迭代行等方式,那么您也可以使其“独立于数据库”,如果这太费力(我估计需要大约7-8小时进行测试),那么您应该考虑其他替代方案,如web2py、ror、django等,但后者的学习曲线相对较长...我的想法很简单,您可以一直编写Delphi代码! - user497849
你有WebBroker与BDE相关的参考资料吗?据我所知,它可以利用任何TDataSet后代。 - LachlanG
显示剩余7条评论
4个回答

4

虽然这是一个老问题,但仍然值得一个最新的回答。

目前已经有解决方案:

IntraWeb:

https://www.atozed.com/intraweb/

uniGUI:

http://unigui.com/

Introduction
uniGUI Web Application Framework extends Web application development experience to a new dimension. uniGUI enables Delphi developers to create, design and debug web applications in IDE using a unique set of visual components. Each component is designed to provide same functionality of its counterpart visual component in Delphi VCL. This provides a very comfortable development environment very close to native VCL application development with an easy learning curve.  uniGUI Web applications can be deployed to a server using one of the available deployment options such as Windows Service, Standalone Server or ISAPI Module.

Product Highlights:

Based on industry's most advanced JavaScript library Sencha Ext JS.
Includes OEM license for Sencha Ext JS. (Please see licensing for details).
A unique platform to create stateful web applications.
Complete IDE support for creating projects, designing forms, frames and handling data modules.
Advanced support for scripting client side JavaScript events.
Library core is fully optimized to achieve highest level of scalability.
Including advanced Stress Test Tool utility.
Comes with various deployment options: ISAPI Module, Standalone Server and Windows Service.
Supported Delphi versions: Turbo Delphi Pro, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, XE2, XE3, XE4, X5, XE6, XE7, XE8, Delphi 10 Seattle, 10.1 Berlin, 10.2.3 Tokyo and 10.3.3 Rio (Win32 & Win64 platforms). (Linux support is in the roadmap)
C++ Builder supported.
Supported Browsers: IE 9+, Microsoft Edge, FireFox, Chrome, Safari and Opera
New state-of-the-art uniGUI HyperServer technology.

TMS WebCore: https://www.tmssoftware.com/site/tmswebcore.asp
RADical Web
Modern SPA web application model
Pure HTML5/CSS3/Javascript based applications
Standard component framework for common UI controls and access to browser features
Debugging in Pascal code via the browser
Backed by a solid & proven Delphi Pascal to Javascript compiler that was years in development

Reuse skills and components Component based RAD development integrated
in the Delphi IDE A truly revolutionary & innovative TMS FNC component
framework that is now also web enabled, allowing to create UI controls
that can be used on VCL, FMX, LCL and WEB! Open to consume other
existing Javascript frameworks & libraries Open to use HTML/CSS for
design Open to use other jQuery controls or even other Javascript
frameworks Offers Pascal class wrappers for jQuery controls from the
jQWidgets library Easy interfacing to REST cloud services including to
TMS XData for database

Easy Deployment Application consists of HTML & Javascript files only
that can be easily deployed on any light or heavyweight webservers Use
any existing load-balancing software and/or techniques for highest
performance Small and convenient debug webserver is included for fast
RAD development

3

虽然Delphi有几个商业选项可用于编写Web应用程序,但我认为Delphi不再包含现代的Web开发解决方案。

如果非要回答你的问题,我会说当前“开箱即用”的Delphi Web框架是WebBroker。WebBroker是Delphi中唯一未被弃用或受功能限制的Web框架。

WebBroker可能早在Delphi 4时就被引入了。它是一个很好的、诚实的工作马,但它自从首次推出以来并没有得到很大改进。它让您自己承担大部分重活,但也不会妨碍您。WebSnap和IntraWeb都是基于WebBroker构建的,这说明了它所提供服务的水平。

多年来,Delphi Enterprise已捆绑了完整版本的IntraWeb,但自Delphi XE以来,它现在有一些限制(无SSL、无ISAPI部署、20分钟闲置超时),很可能意味着你需要从AtoZed购买许可证才能严肃地使用它。

Delphi Pro捆绑的IntraWeb版本一直太过有限,仅能视作评估版。

2

http://docwiki.embarcadero.com/RADStudio/en/DataSnap_Overview_and_Architecture

DataSnap 已经存在很长一段时间了,而最新的版本已经不需要使用 DCOM 了。您可以利用它来构建服务器端代码(在 C/S 和 B/S 中都是 S)。它目前的角色几乎就像 .NET 世界中的 WCF。
如果您正在构建一个网站前端,您可以使用 IW。但是,DataSnap 甚至使使用 PHP 或其他 Web 技术构建前端也成为可能。

我好像没有那个。那是只有企业版才有的吗? - Mason Wheeler
它只在高于专业版的版本中提供。http://www.embarcadero.com/images/Delphi/delphi_short_feature_matrix_large.png - Lex Li
4
我认为 Web 应用程序框架 更像是 ASP.NET,是一种构建动态网站的工具。我认为 DataSnap 更适属于 Web 服务类别。 - mjn

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接