客户端-服务器应用程序:从本地服务器或版本化界面自动更新?
我有一个客户端/服务器应用程序,我正在寻找一些有关如何处理两者之间的接口的建议。服务器/客户端将部署在 LAN(可能是 WAN,但肯定是客户管理的,而不是集中式服务器)上。我正在考虑这两个选项:
- 客户端和服务器可以是不同的版本。这样,它们之间的 WCF 接口必须支持版本控制 - 如果一个已更新而另一个未更新,应用程序仍然需要工作。
- 服务器将更新推送到客户端,客户端在通信之前自动安装更新。不需要版本控制,因为服务器不会与过时的客户端通信。
客户端是作为 LocalSystem 运行的 Window 服务,因此自动更新不存在权限问题。 #2 看起来更干净,因为没有界面版本控制可供跟踪,但我担心我错过了一个非常明显的理由,不这样做有利于 #1。客户端应用程序很小 - 不到 500K - 因此推送更新的带宽(我预计不会频繁)也不是真正的问题。
I have a client/server application and I'm looking for some advice about how to handle the interface between the two. The Server/clients will be deployed over a LAN (potentially WAN, but definitely customer-managed, not centralized server). I'm considering these two options:
- Client and Server can be different versions. This way, the WCF interface between them has to support versioning - if one has been updated and not the other, app still needs to work.
- Server pushes updates to client, client auto-installs update before communicating. No versioning required, as the server won't communicate with an out-of-date client.
The client is a Window service that's running as LocalSystem, so there are no permissions concerns with an auto-update. #2 seems cleaner, as there's no interface versioning to keep track of, but I'm afraid I'm missing a really obvious reason to not do this in favor of #1. The client app is small - under 500K - so the bandwidth of pushing out updates (which I don't expect to be frequent) isn't really a concern either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我可能会推荐两者的组合。首先,为您希望使用的 WCF 库版本设置基线,其中包括 System.Serialization,因为它包含 DataContract 属性。
在引用中明确定义这些版本,以便在升级 .NET 版本时,它将继续使用旧版本而不是新版本。然后,您应该可以自由升级所有其他引用的库,而不必担心升级会影响您的界面。
至于实现第二个选项,我几乎建议在客户端上设置第二个服务,仅处理从服务器获取升级信息。如果需要升级 WCF 库,则可以推送这些更新(但是,这种情况可能不会经常发生)。
I might recommend a combination of the two. First off, set a baseline for what version of the WCF libs, you wish to use, which includes System.Serialization since it includes the DataContract attributes.
Define these versions explicitly in your references so that if you upgrade the .NET version, it will continue to use the old version and not the new. Then, you should be free to upgrade all other referenced libraries without concern over the upgrades affecting your interface.
As far as implementing the second option, I would almost recommend setting up a second service on the client that deals solely with getting upgrade information from the server. If it is necessary to upgrade the WCF libs, then those updates could be pushed (however, this probably won't happen very often).
去自动更新。版本控制带来了复杂性,在这种情况下您可以简单地避免这种复杂性。
Go for auto update. Versioning brings in a complexitiy that you simply can do without in this scenario.