用于观看FTP站点的程序的良好C#模式 [英] Good C# pattern to use for a program that will watch an FTP site

查看:78
本文介绍了用于观看FTP站点的程序的良好C#模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用于查看收到文件的FTP站点的程序有什么好的C#模式?具体来说,考虑到高可用性/企业级故障转移的模式。

What is a good C# pattern to use for a program that will watch an FTP site for files received? Specifically, a pattern that with high-availability / enterprise-level failover in mind.

推荐答案

问题的整个表述是明显的反模式的。请参阅:

https://en.wikipedia.org/wiki/Anti-pattern #Software_engineering [ ^ ]。

一个反模式是众所周知的,可以在本文发布的反模式列表中找到:参见模式的使用本身被称为反模式,一个标志,系统没有采用足够的抽象。



我制定了类似的方法论问题:认为使用某种模式是发展的目标。 />


另一个反模式不在列表中。我称之为:使用需要轮询的架构。要了解此问题,请参阅我之前的回答:网站帐户的应用'信息中心' [ ^ ]。



请注意,我在这个答案中试图概述的问题无法通过FTP解决,FTP本身就是面向纯客户端 - 服务器模型 https://en.wikipedia.org/wiki/Client%E2%80% 93server_model [ ^ ]) 。使用HTTP,这很困难,但有解决办法,但没有FTP。



所以,底线是:你不需要寻找这种方法的模式。您可以在两个方向上工作1)将架构更改为不包括轮询的架构; 2)仍然可以探索来自FTP的轮询,如果这是不可避免的,只需使用批判性思维和你的大脑以合理的方式设计解决方案。哪种方式?这取决于你没有与我们分享的其他要求和最终目标。



-SA
The whole formulation of the problem is the apparent anti-pattern. Please see:
https://en.wikipedia.org/wiki/Anti-pattern#Software_engineering[^].
One anti-pattern is well-known and can be found in the list of anti-pattern published in this article: see "The use of patterns has itself been called an anti-pattern, a sign that a system is not employing enough abstraction".

I formulate the similar methodological problem like this: "thinking that the use of some pattern is the goal of development".

Another anti-pattern is not in the list. I call it: using the architecture which requires polling. To understand the problem, please see my past answer: Application 'dashboard' for website accounts[^].

Note that the problems I tried to outline in this answer cannot be solved with FTP, which is inherently oriented to pure client-server model (https://en.wikipedia.org/wiki/Client%E2%80%93server_model[^]). With HTTP, it is just difficult, but there are work-around solutions, but not with FTP.

So, the bottom-line is: you don't need to look for a pattern for this approach. You can work in two directions 1) change the architecture to the one excluding polling; 2) still explore the polling from FTP, if this is unavoidable, but simply use critical thinking and your brain to design the solution in a rational ways. Which ways? it depends on your other requirements and ultimate goals, which you did not share with us.

—SA

这篇关于用于观看FTP站点的程序的良好C#模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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