如何更快地使用Web服务进行开放式winform [英] How to make opening winform with web service faster

查看:69
本文介绍了如何更快地使用Web服务进行开放式winform的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。



我正在维护一个拥有许多客户端的系统,以便在服务器上使用Web服务。我们的程序是winform应用程序,其中一些Web服务对象以多种形式声明,因为我们在服务器上处理了重要的操作。每个winform程序都包含一个主窗体和数十个子窗体,其中Web服务对象被声明为窗体级对象。



问题是当Web服务对象是不仅声明,而且在表格开头初始化,表格的开头将是如此缓慢。如何批准创建胜利表格的表现?

Hello.

I am maintaining a system with many clients to use web services on a server. Our programs are winform applications with some web service objects declared in many forms because we made the important operations to be processed on the server. Each winform program contains a main form and tens of child forms with web service objects declared as form-level objects in them.

The problem is when the web service objects are not only declared, but also initialized at the opening of the form, the opening of the form will be so slow. How can I approve the performance the win form creation?

推荐答案

拳头,请看我对这个问题的评论。



现在,正如我所说的,更快启动应用程序真的很有意义。由于您没有提供任何有助于提高性能的信息(总体吞吐量,考虑到人为因素),因此如果客户端预先初始化的服务对象,您可以解决问题。你应该考虑过早地初始化它们。相反,您可以实施按需拨打策略:

http: //en.wikipedia.org/wiki/Call_by_need [ ^ ]。



基本上,您应该使用空引用保留服务集,并且仅在您要对每个服务执行第一次调用时初始化它们。他们。检查是否为null,如果为null,则执行初始化。



-SA
Fist, please see my comment to the question.

Now, as I say, it really may make sense to startup the application sooner. As you did not provide any information useful to help you to improve performance (overall throughput, taking into account the human factor), you can address the problem if pre-initialized service objects on the client side. You should think about initialization of them prematurely. Instead, you can implement the call-by-need strategy:
http://en.wikipedia.org/wiki/Call_by_need[^].

Basically, you should keep the set of services with null references, and initialize them only when you are about to perform the very first call to each of them. Check for null, and if it is null, perform initialization.

—SA


这篇关于如何更快地使用Web服务进行开放式winform的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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