473,322 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Windows service design question

I'm trying to finalize a windows service design any would appreciate any
comments - I'm new to windows services.

Essentially my UI app relies on a service to schedule IO tasks. The service
does nothing but keep track of elapsed time.

The reason I need a service is because the IO tasks are login agnostic. It
doesn't matter if anyone, or no one, is logged in. The IO tasks are defined
in the UI.

When the service starts, it reads from an xml file to get initial values for
its counters (a series of integer ProjectIDs and TimeSpan values). If
during the current system session, the elapsed System Uptime exceeds any of
the service's counters, IO tasks need to be run.

The catch is that the business logic required to run these IO tasks is
contained in the UI app. Each service counter consists of a ProjectID and a
TimeSpan: the Project corresponding to the ProjectID is defined in the UI,
and the TimeSpan value is a ticking count based on System Uptime, maintained
by the service.

How can the service interact with the UI app to utilize business logic in
the UI app?

Can I initialize an object in the UI app from the service?

How can I pass the service's TimeSpan to the UI app?

Can the UI app access the service's TimeSpan value at any given point?

Must I use remoting?

Other options?
Mar 2 '06 #1
7 3073

"deko" <de**@nospam.com> wrote in message
news:kr******************************@comcast.com. ..
| I'm trying to finalize a windows service design any would appreciate any
| comments - I'm new to windows services.
|
| Essentially my UI app relies on a service to schedule IO tasks. The
service
| does nothing but keep track of elapsed time.
|
| The reason I need a service is because the IO tasks are login agnostic.
It
| doesn't matter if anyone, or no one, is logged in. The IO tasks are
defined
| in the UI.
|
| When the service starts, it reads from an xml file to get initial values
for
| its counters (a series of integer ProjectIDs and TimeSpan values). If
| during the current system session, the elapsed System Uptime exceeds any
of
| the service's counters, IO tasks need to be run.
|
| The catch is that the business logic required to run these IO tasks is
| contained in the UI app. Each service counter consists of a ProjectID and
a
| TimeSpan: the Project corresponding to the ProjectID is defined in the UI,
| and the TimeSpan value is a ticking count based on System Uptime,
maintained
| by the service.
|
| How can the service interact with the UI app to utilize business logic in
| the UI app?
|
| Can I initialize an object in the UI app from the service?
|
| How can I pass the service's TimeSpan to the UI app?
|
| Can the UI app access the service's TimeSpan value at any given point?
|
| Must I use remoting?
|
| Other options?
|
|

This question has been answered a couple of weeks ago, and the answer is
still the same. Yes, you can use remoting for this, but you are not
restricted to remoting, you can use any possible alternative like sockets
named pipes etc to create a communication channel between both UI and
Service. Considered that both UI and Service are managed code applications,
the obvious solution is to use remoting.

Willy.
Mar 2 '06 #2
I not sold that you need another service for this. Why could not the UI spin
up a scheduler when it starts? You thinking something QB scheduler here?

--
William Stacey [MVP]

"deko" <de**@nospam.com> wrote in message
news:kr******************************@comcast.com. ..
| I'm trying to finalize a windows service design any would appreciate any
| comments - I'm new to windows services.
|
| Essentially my UI app relies on a service to schedule IO tasks. The
service
| does nothing but keep track of elapsed time.
|
| The reason I need a service is because the IO tasks are login agnostic.
It
| doesn't matter if anyone, or no one, is logged in. The IO tasks are
defined
| in the UI.
|
| When the service starts, it reads from an xml file to get initial values
for
| its counters (a series of integer ProjectIDs and TimeSpan values). If
| during the current system session, the elapsed System Uptime exceeds any
of
| the service's counters, IO tasks need to be run.
|
| The catch is that the business logic required to run these IO tasks is
| contained in the UI app. Each service counter consists of a ProjectID and
a
| TimeSpan: the Project corresponding to the ProjectID is defined in the UI,
| and the TimeSpan value is a ticking count based on System Uptime,
maintained
| by the service.
|
| How can the service interact with the UI app to utilize business logic in
| the UI app?
|
| Can I initialize an object in the UI app from the service?
|
| How can I pass the service's TimeSpan to the UI app?
|
| Can the UI app access the service's TimeSpan value at any given point?
|
| Must I use remoting?
|
| Other options?
|
|
Mar 3 '06 #3
> This question has been answered a couple of weeks ago, and the answer is
still the same. Yes, you can use remoting for this, but you are not
restricted to remoting, you can use any possible alternative like sockets
named pipes etc to create a communication channel between both UI and
Service. Considered that both UI and Service are managed code
applications,
the obvious solution is to use remoting.


Thanks for the reply. I guess I was just looking for more feedback - but I
think you are correct, remoting is the way to go. However, I think I may be
able to make a design change so NO communication will be required between
the UI and the service - other than the UI being able to stop/start/pause
the service.

I tried to design a solution without a service but the app is designed for a
server as well as a workstation. And it's supposed to be a system-wide
utility, not a user-specific tool. But you did challenge me to re-evaluate
this idea.
Mar 3 '06 #4
>I not sold that you need another service for this. Why could not the UI
spin
up a scheduler when it starts? You thinking something QB scheduler here?


QB scheduler? What's that?

Mar 3 '06 #5
Quick Books. Do you really need a shared scheduler or could you not do it
inproc?

--
William Stacey [MVP]

"deko" <de**@nospam.com> wrote in message
news:Td********************@comcast.com...
| >I not sold that you need another service for this. Why could not the UI
| >spin
| > up a scheduler when it starts? You thinking something QB scheduler
here?
|
| QB scheduler? What's that?
|
Mar 3 '06 #6
> Quick Books. Do you really need a shared scheduler or could you not do it
inproc?


inproc? what's that? in-process? what do you mean?

The design goal for this app is for things to happen at intervals of system
uptime. If I wanted a calendar-based scheduler I'd use the Task Scheduler,
which, I think, in .NET 2.0, can be accessed with managed code (it could not
in 1.1).
Mar 3 '06 #7
in-process (i.e. same app, different thread). When the app starts, just
spin another thread and have it record the system uptime. Then do what you
want. What are the intervals, why from system start time? Would app start
time be better? How about some interval from some 12:00 today? Need more
info.

--
William Stacey [MVP]

"deko" <de**@nospam.com> wrote in message
news:sM********************@comcast.com...
|> Quick Books. Do you really need a shared scheduler or could you not do
it
| > inproc?
|
| inproc? what's that? in-process? what do you mean?
|
| The design goal for this app is for things to happen at intervals of
system
| uptime. If I wanted a calendar-based scheduler I'd use the Task
Scheduler,
| which, I think, in .NET 2.0, can be accessed with managed code (it could
not
| in 1.1).
|
|
Mar 3 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Michael Riggio | last post by:
Is there a way to have a windows service instantiate a class that is a web service, which will then be accessible to clients via HTTP? Thanks, -Mike
5
by: Steve Long | last post by:
Hello, I hope this question isn't too fundamental. I have a feeling it is. I'm trying to start a winform app from a windows service written in C#. I created a class and used it from a windowsforms...
3
by: Yves Royer | last post by:
Hi all, I have a little question about Windows Services. For my app i need 3 different Windows Services, each with its own functionality. I'm trying to make a test service to see what happens...
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
2
by: shyam | last post by:
I have a C++ COM based windows service which have more than 30k lines of code and which is stablized over years. We need to take the advantage of the ..NET framework for this project, especially...
4
by: jez123456 | last post by:
Hi Experts I've written a c# windows service which runs another program at certain intervals. The other program may take upto 20 minutes to complete it's tasks. My question is what happens to...
2
by: =?Utf-8?B?Sm9obiBG?= | last post by:
Hello All, I have a question about using an ActiveX control with a Windows Servce in C#. I believe it is not possible to properly setup an ActiveX control in a windows service as the particular...
15
by: Angelo | last post by:
Hi all, I'm using a FileSystemWatcher to monitor a directory. I want the FSW to pop up my already instantiated but invisible form. However, I'm running into some problems with this. 1) In...
41
by: pbd22 | last post by:
Hi. I know my windows service works when i run it in debug mode on my dev machine. It also works in release mode on my dev machine. But, when I move the service to a production server, it...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.