编写具有太多数据收集过程的程序的最佳实践C#

时间:2021-06-02 21:47:13

I have to login in to various elements to retrieve some data, problem is each element has its own login credentials, I want to write all such data collection processes into one single program so that I dont have 10 different scheduled processes to look at.

我必须登录各种元素来检索一些数据,问题是每个元素都有自己的登录凭据,我想将所有这些数据收集进程写入一个单独的程序,这样我就没有10个不同的计划进程来查看。

Did any of you have such a challenge, if so how did you go about it? I am right now doing it the top down way, so its after the first data collection process gets implemented the program goes for the next...

你有没有这样的挑战,如果是这样的话你是怎么做到的?我现在正在做自上而下的方式,所以它在第一个数据收集过程实现后,程序进入下一个...

I know that this is not the right way, I have threads and processes in mind, but being a beginner I'm kinda lost now.

我知道这不是正确的方法,我心中有线程和流程,但作为一个初学者,我现在有点失落。

2 个解决方案

#1


if the process of collecting data of the different sources is taking longer you could get faster results if you do it with multithreading and callbacks, but if in normal case it takes not really long, why not make it as simple as possible.

如果收集不同来源的数据的过程花费的时间更长,那么如果你使用多线程和回调,你可以获得更快的结果,但如果在正常情况下它需要的时间不长,为什么不尽可能简单。

#2


Its going to depend on how you need to login to each element, and what it means to "collect" the data. If you can give some specific types of elements (SQL, Oracle, AS/400, etc) and what you are trying to get out of them, then we can help you get started with automating the process.

它将取决于您需要如何登录每个元素,以及“收集”数据的含义。如果您可以提供一些特定类型的元素(SQL,Oracle,AS / 400等)以及您试图从中获取的内容,那么我们可以帮助您开始自动化该过程。

#1


if the process of collecting data of the different sources is taking longer you could get faster results if you do it with multithreading and callbacks, but if in normal case it takes not really long, why not make it as simple as possible.

如果收集不同来源的数据的过程花费的时间更长,那么如果你使用多线程和回调,你可以获得更快的结果,但如果在正常情况下它需要的时间不长,为什么不尽可能简单。

#2


Its going to depend on how you need to login to each element, and what it means to "collect" the data. If you can give some specific types of elements (SQL, Oracle, AS/400, etc) and what you are trying to get out of them, then we can help you get started with automating the process.

它将取决于您需要如何登录每个元素,以及“收集”数据的含义。如果您可以提供一些特定类型的元素(SQL,Oracle,AS / 400等)以及您试图从中获取的内容,那么我们可以帮助您开始自动化该过程。