The best method for designing a low profile client application
-
Hi all. I would like to write a program that will function as a client on a remote computer. The idea is that at a given time i will be able to request specific actions from the client application. Remotely, of course. Up to now i have considered two ways of doing this: 1. Use a DB on the server. The client will poll the DB for tasks at a standard rate and act as insrtucted there. 2. Use a web-service. The client will call a getTasks() method at a standard rate. Both of these methods include polling the server at a fixed interval. This is necessary, since i need the client application to respond almost immediateley to server requests. The thing is, i don't want these applications to interfere with the user's use-experience. I don't want him to feel that he has my application running in the background and polling every now and then. So: Are my concerns justified? If so, what would you suggest as a substitute? If not, which of the above would you suggest? Thanks for reading all the way down here. I will really appreciate your responses. SummerBulb.
-
Hi all. I would like to write a program that will function as a client on a remote computer. The idea is that at a given time i will be able to request specific actions from the client application. Remotely, of course. Up to now i have considered two ways of doing this: 1. Use a DB on the server. The client will poll the DB for tasks at a standard rate and act as insrtucted there. 2. Use a web-service. The client will call a getTasks() method at a standard rate. Both of these methods include polling the server at a fixed interval. This is necessary, since i need the client application to respond almost immediateley to server requests. The thing is, i don't want these applications to interfere with the user's use-experience. I don't want him to feel that he has my application running in the background and polling every now and then. So: Are my concerns justified? If so, what would you suggest as a substitute? If not, which of the above would you suggest? Thanks for reading all the way down here. I will really appreciate your responses. SummerBulb.
I'd suggest you to got with choice 2. Use a web service or WCF to communicate with DB. This avoid tight coupling of client application with database.
SummerBulb wrote:
I don't want him to feel that he has my application running in the background and polling every now and then.
So users won't be using your application directly? If not, you can start it and keep it in "System tray". Have a thread which does the polling.
Best wishes, Navaneeth
-
I'd suggest you to got with choice 2. Use a web service or WCF to communicate with DB. This avoid tight coupling of client application with database.
SummerBulb wrote:
I don't want him to feel that he has my application running in the background and polling every now and then.
So users won't be using your application directly? If not, you can start it and keep it in "System tray". Have a thread which does the polling.
Best wishes, Navaneeth
N a v a n e e t h wrote:
Have a thread which does the polling
I don't mind having the application in the background. My dillemma is concerning the CPU, memory and internet bandwidth.
-
N a v a n e e t h wrote:
Have a thread which does the polling
I don't mind having the application in the background. My dillemma is concerning the CPU, memory and internet bandwidth.
SummerBulb wrote:
My dillemma is concerning the CPU, memory and internet bandwidth.
It'd be a premature optimization. I'd suggest to make the application working first. Profile it and see whether it requires optimizations. BTW, you can consider few things when you develop. 1 - Ensure calls to
Dispose()
for all disposable objects - CLR manages the memory quite well and you don't have to worry much about it. Few classes in the .NET framework implementsIDisposable
and make sure you callDispose()
method on it to avoid resource leaks. 2 - Don't send unnecessary informations over the wire - I have found WCF services perform better than SOAP based web services. But you need to understand how WCF does the communication. When you send large objects/collections, it will be slow. So make sure you send only the necessary information. Once you done with the application, profile it and find out the areas that can be optimized further.Best wishes, Navaneeth
-
SummerBulb wrote:
My dillemma is concerning the CPU, memory and internet bandwidth.
It'd be a premature optimization. I'd suggest to make the application working first. Profile it and see whether it requires optimizations. BTW, you can consider few things when you develop. 1 - Ensure calls to
Dispose()
for all disposable objects - CLR manages the memory quite well and you don't have to worry much about it. Few classes in the .NET framework implementsIDisposable
and make sure you callDispose()
method on it to avoid resource leaks. 2 - Don't send unnecessary informations over the wire - I have found WCF services perform better than SOAP based web services. But you need to understand how WCF does the communication. When you send large objects/collections, it will be slow. So make sure you send only the necessary information. Once you done with the application, profile it and find out the areas that can be optimized further.Best wishes, Navaneeth
Thank you very much for your replies. Does the WCF differ much from the SOAP? (this must sound like a very silly question to someone whoe knows them both well...)
modified on Sunday, December 6, 2009 4:51 AM
-
Thank you very much for your replies. Does the WCF differ much from the SOAP? (this must sound like a very silly question to someone whoe knows them both well...)
modified on Sunday, December 6, 2009 4:51 AM
-
Hi all. I would like to write a program that will function as a client on a remote computer. The idea is that at a given time i will be able to request specific actions from the client application. Remotely, of course. Up to now i have considered two ways of doing this: 1. Use a DB on the server. The client will poll the DB for tasks at a standard rate and act as insrtucted there. 2. Use a web-service. The client will call a getTasks() method at a standard rate. Both of these methods include polling the server at a fixed interval. This is necessary, since i need the client application to respond almost immediateley to server requests. The thing is, i don't want these applications to interfere with the user's use-experience. I don't want him to feel that he has my application running in the background and polling every now and then. So: Are my concerns justified? If so, what would you suggest as a substitute? If not, which of the above would you suggest? Thanks for reading all the way down here. I will really appreciate your responses. SummerBulb.
What's the "fixed interval"? If "almost immediately" is less than 5 minutes, consider to could connect to a server, stay connected, and receive an event when there's a new task. No polling required, tasks arrive immediately. If you're using WCF, you can do this Duplex Services[^].
-
Hi all. I would like to write a program that will function as a client on a remote computer. The idea is that at a given time i will be able to request specific actions from the client application. Remotely, of course. Up to now i have considered two ways of doing this: 1. Use a DB on the server. The client will poll the DB for tasks at a standard rate and act as insrtucted there. 2. Use a web-service. The client will call a getTasks() method at a standard rate. Both of these methods include polling the server at a fixed interval. This is necessary, since i need the client application to respond almost immediateley to server requests. The thing is, i don't want these applications to interfere with the user's use-experience. I don't want him to feel that he has my application running in the background and polling every now and then. So: Are my concerns justified? If so, what would you suggest as a substitute? If not, which of the above would you suggest? Thanks for reading all the way down here. I will really appreciate your responses. SummerBulb.
I've had good success with having a Windows Service poll a database to get information on tasks to perform. It could use a Web Service to access the database. You can also define a custom action for the Windows Service that will allow the server to trigger the action of the client.