将Delphi应用程序转换为作为服务运行 - 是否有必要? [英] Converting a Delphi application to run as a service - is it necessary?

查看:244
本文介绍了将Delphi应用程序转换为作为服务运行 - 是否有必要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个delphi应用程序,用于记录来自不同地方的数据,并将数据写入文件。该应用程序具有相当广泛的GUI,允许显示数据,配置选项等。



一个用户已经请求将应用更改为可以作为服务运行。他的推理是,应用程序可以在启动时启动,运行时没有任何用户登录,无论谁登录了都可以使用。



我的问题是这有什么其他解决方案可以使我安装它现在存在的应用程序,以便它仍然运行,没有用户登录,仍然可用于所有用户?



我的直觉是,将应用程序转换为运行为服务不是微不足道的。我假设您将需要2个应用程序 - 无头服务应用程序,以及由用户可以与服务进行交互的用户运行的GUI(也欢迎在此处发表评论)。

解决方案

有商业(和免费)解决方案,如 Firedaemon ,它将运行(几乎)任何应用程序作为服务。



在sidenote,它不应该真的很难分离逻辑和用户界面 - 你应该已经完成​​了,当你开发的应用程序。只是因为Delphi可以轻松地将业务逻辑写入与用户界面相关联的代码中,这并不意味着您应该真正做到这一点。看看 Martin Fowler的网站上的演示模式。


I have a delphi app that logs data from various places and writes the data to a file. The app has quite an extensive GUI to allow display of the data, configuration of the options, etc.

One user has requested that the app be changed to that it can be run as a service. His reasoning is that the app could then be started at boot time and run without any user being logged in and would be available regardless of who was logged in.

My question is this: Is there any other solution that would enable me to install the app as it now exists so that it would still run with no user logged in and still be available to all users?

My gut feeling is that converting the app to run as a service is not trivial. I assume you would need 2 apps - the "headless" service application, and a GUI that was run by users on demand that could interact with the service (comments welcome here also).

解决方案

There are commercial (and free) solutions like Firedaemon, which will run (almost) any application as a service.

On a sidenote, it shouldn't really be hard to separate logic and user interface - you should've done that already when you developed the application. Just because Delphi makes it easy to write business logic in the code behind associated with the user interface, that doesn't mean you should really do it. Have a look at the presentation pattern's at Martin Fowler's site.

这篇关于将Delphi应用程序转换为作为服务运行 - 是否有必要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆