Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. The best method for designing a low profile client application

The best method for designing a low profile client application

Scheduled Pinned Locked Moved C#
databasesysadminquestionlearning
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SummerBulb
    wrote on last edited by
    #1

    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.

    N D P 3 Replies Last reply
    0
    • S 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.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • N N a v a n e e t h

        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

        S Offline
        S Offline
        SummerBulb
        wrote on last edited by
        #3

        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 1 Reply Last reply
        0
        • S SummerBulb

          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 Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          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 implements IDisposable and make sure you call Dispose() 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

          S 1 Reply Last reply
          0
          • N N a v a n e e t h

            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 implements IDisposable and make sure you call Dispose() 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

            S Offline
            S Offline
            SummerBulb
            wrote on last edited by
            #5

            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

            N 1 Reply Last reply
            0
            • S SummerBulb

              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

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              SummerBulb wrote:

              Does the WCF differ much from the SOAP?

              Yes. SOAP is a protocol where WCF is a framework for creating service oriented applications. WCF can communicate using SOAP protocol if needed. Here[^] is a good MSDN article on WCF's capabilities.

              Best wishes, Navaneeth

              1 Reply Last reply
              0
              • S 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.

                D Offline
                D Offline
                Daniel Grunwald
                wrote on last edited by
                #7

                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[^].

                1 Reply Last reply
                0
                • S 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.

                  P Offline
                  P Offline
                  PIEBALDconsult
                  wrote on last edited by
                  #8

                  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.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups