Windows Services

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Windows Services

    I have a medical app that I have written with a rich user interface. A
    section of the code in it does some mundane processing such as printing,
    billing, faxing etc. The machine that is supposed to execute this code is
    identified by it's name in a configuration table. When the app starts - it
    looks at that table - compares it's name and starts executing this code (on
    a timer)

    This has been working great - but I know I need to turn it into a window's
    service because the Admin is getting sick of logging into a terminal
    session - starting the app etc. every time he reboots the system.

    What is great about the current set up is that I don't have to maintain two
    sets of code. Is there a way I can configure my desktop app to run as a
    service if I want it to?

    Thanks,

    David



  • Kevin Spencer

    #2
    Re: Windows Services

    Hi David,
    [color=blue]
    > Is there a way I can configure my desktop app to run as a service if I
    > want it to?[/color]

    There sure is. It won't be as easy now if it would have been if it was
    correctly designed in the first place, but in the future you will be able to
    host your app in any type of user interface or API.

    The solution is to separate the business programming logic from the
    interface logic. In other words, the actual work that your current app does
    should be encapsulated in a set of business classes that provide an API for
    your various types of interfaces to get at.

    Good OOP application design dictates that the interface should take care of
    itself, and the business "layer" should take care of itself. In essence, the
    interface is a "client" to the business layer, which has no interface other
    than an API.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    A brute awe as you,
    a Metallic hag entity, eat us.


    <drchips@nospam .nospam> wrote in message
    news:Od8I4WXOGH A.3924@TK2MSFTN GP14.phx.gbl...[color=blue]
    >I have a medical app that I have written with a rich user interface. A
    >section of the code in it does some mundane processing such as printing,
    >billing, faxing etc. The machine that is supposed to execute this code is
    >identified by it's name in a configuration table. When the app starts - it
    >looks at that table - compares it's name and starts executing this code (on
    >a timer)
    >
    > This has been working great - but I know I need to turn it into a window's
    > service because the Admin is getting sick of logging into a terminal
    > session - starting the app etc. every time he reboots the system.
    >
    > What is great about the current set up is that I don't have to maintain
    > two sets of code. Is there a way I can configure my desktop app to run as
    > a service if I want it to?
    >
    > Thanks,
    >
    > David
    >
    >
    >[/color]


    Comment

    • Mark

      #3
      Re: Windows Services

      You could write a service easily in .NET. Look into using a scheduled task,
      that may be a lot easier.

      Cheers,
      Mark

      "Kevin Spencer" wrote:
      [color=blue]
      > Hi David,
      >[color=green]
      > > Is there a way I can configure my desktop app to run as a service if I
      > > want it to?[/color]
      >
      > There sure is. It won't be as easy now if it would have been if it was
      > correctly designed in the first place, but in the future you will be able to
      > host your app in any type of user interface or API.
      >
      > The solution is to separate the business programming logic from the
      > interface logic. In other words, the actual work that your current app does
      > should be encapsulated in a set of business classes that provide an API for
      > your various types of interfaces to get at.
      >
      > Good OOP application design dictates that the interface should take care of
      > itself, and the business "layer" should take care of itself. In essence, the
      > interface is a "client" to the business layer, which has no interface other
      > than an API.
      >
      > --
      > HTH,
      >
      > Kevin Spencer
      > Microsoft MVP
      > ..Net Developer
      > A brute awe as you,
      > a Metallic hag entity, eat us.
      >
      >
      > <drchips@nospam .nospam> wrote in message
      > news:Od8I4WXOGH A.3924@TK2MSFTN GP14.phx.gbl...[color=green]
      > >I have a medical app that I have written with a rich user interface. A
      > >section of the code in it does some mundane processing such as printing,
      > >billing, faxing etc. The machine that is supposed to execute this code is
      > >identified by it's name in a configuration table. When the app starts - it
      > >looks at that table - compares it's name and starts executing this code (on
      > >a timer)
      > >
      > > This has been working great - but I know I need to turn it into a window's
      > > service because the Admin is getting sick of logging into a terminal
      > > session - starting the app etc. every time he reboots the system.
      > >
      > > What is great about the current set up is that I don't have to maintain
      > > two sets of code. Is there a way I can configure my desktop app to run as
      > > a service if I want it to?
      > >
      > > Thanks,
      > >
      > > David
      > >
      > >
      > >[/color]
      >
      >
      >[/color]

      Comment

      • TerryFei

        #4
        RE: Windows Services

        Hi,

        I hope the following article is also helpful for you:
        Title: Simple Windows Service Sample
        URL: http://www.codeproject.com/dotnet/si...owsservice.asp

        Best Regards,

        Terry Fei [MSFT]
        Microsoft Community Support
        Get Secure! www.microsoft.com/security

        --------------------[color=blue]
        >From: <drchips@nospam .nospam>
        >Subject: Windows Services
        >Date: Fri, 24 Feb 2006 14:08:48 -0500
        >Lines: 21
        >X-Priority: 3
        >X-MSMail-Priority: Normal
        >X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
        >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
        >X-RFC2646: Format=Flowed; Original
        >Message-ID: <Od8I4WXOGHA.39 24@TK2MSFTNGP14 .phx.gbl>
        >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
        >NNTP-Posting-Host: unknown.sagonet .net 66.118.147.130
        >Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP14.phx. gbl
        >Xref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.langua ges.csharp:3882 82
        >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
        >
        >I have a medical app that I have written with a rich user interface. A
        >section of the code in it does some mundane processing such as printing,
        >billing, faxing etc. The machine that is supposed to execute this code is
        >identified by it's name in a configuration table. When the app starts -[/color]
        it[color=blue]
        >looks at that table - compares it's name and starts executing this code[/color]
        (on[color=blue]
        >a timer)
        >
        >This has been working great - but I know I need to turn it into a window's
        >service because the Admin is getting sick of logging into a terminal
        >session - starting the app etc. every time he reboots the system.
        >
        >What is great about the current set up is that I don't have to maintain[/color]
        two[color=blue]
        >sets of code. Is there a way I can configure my desktop app to run as a
        >service if I want it to?
        >
        >Thanks,
        >
        >David
        >
        >
        >
        >[/color]

        Comment

        Working...