To service or not to service

P

pigeonrandle

Hi,
I am writing a server application and would like to know what you
experts think i should write it as. I would like (ie need) it to have a
visual interface, hence the question,
"Should i write it as a service and then provide another program that
displays information on what's going on", or, "should i simply write it
as a multi-threaded asynchronous socket beast GUI"?!

I like the second option (mainly because it will involve less typing
:blush:).

If you think the first option is a better one, i would love to hear
your reasons why.

Many thanks (once again),
Your friend and mine,
James Randle.
 
P

pigeonrandle

I think i should also add, if you're opting for option one, then am i
overdramatising what i conceive as a 'more difficult task' - getting
information out of the service.

Again, many thanks for your forthcoming input,
James Randle.
 
W

William Stacey [MVP]

From your question, I don't see the need to use a service. If so, I would
not write a service just to write one, as deployment is also a concern.
Will this be a server listening for request/reply?

--
William Stacey [MVP]

| Hi,
| I am writing a server application and would like to know what you
| experts think i should write it as. I would like (ie need) it to have a
| visual interface, hence the question,
| "Should i write it as a service and then provide another program that
| displays information on what's going on", or, "should i simply write it
| as a multi-threaded asynchronous socket beast GUI"?!
|
| I like the second option (mainly because it will involve less typing
| :blush:).
|
| If you think the first option is a better one, i would love to hear
| your reasons why.
|
| Many thanks (once again),
| Your friend and mine,
| James Randle.
|
 
J

José Joye

When I need to determine if I have to write a Service, I always ask me the
following questions:

- Do I need to have the application running without any user connected?
- Do I need to have the application running at the computer start?

If I answer yes to one of these, then I go for a service...


- José
 
G

Guest

In general if you need a visual interface, this should be outside the
service. Setting "Allow interaction with the Desktop" can cause numerous
problems. If you need for your GUI to "talk" to the service you could use
Remoting, named pipes or a socket server / client arrangement built into the
service.
Peter
 
P

pigeonrandle

William and José,
Thankyou both for replying.

The server will be listening for tcp connections and sending data back.
And i think i will need a user logged in because ... what really
complicates this project is the fact that the server will also be
responsible for remote controlling another application (using
WM_SETTEXT and friends). (It also updates databases, but i imagine this
can be done without a user being logged in?)

What on earth have i let myself in for!
James Randle.
 
P

pigeonrandle

William and José,
Thankyou both for replying.

The server will be listening for tcp connections and sending data back.
And i think i will need a user logged in because ... what really
complicates this project is the fact that the server will also be
responsible for remote controlling another application (using
WM_SETTEXT and friends). (It also updates databases, but i imagine this
can be done without a user being logged in?)

And yes, it does need to be running on startup ... but i guess i need
to have a user log in first anyway.

What on earth have i let myself in for!
James Randle.

Apologies if there are two versions of this message ... i had an
afterthought :blush:)
 
P

pigeonrandle

Peter,
Thanks for your input. My dad said i should have been a gardener and
what with the seeds of doubt being planted in my mind, i think i would
have made a good one!

Given my further explanation above do you have anything else you could
add? From what William and José have added, i am beginning to think
that i cant do this with a service (unless a service can spawn an
application without a user being logged in that is...)

Cheers,
James.
 
J

José Joye

Assuming the application(s) your service must spawn has no interaction with
the desktop, there is no restriction about it.
I have implemented several services that spawned applications (even old C
applications [console applications] with input/output interactions managed
by the service) and this was no problem at all.

Regarding the front-end, I used to implement windows forms that communicated
through remoting (this is easier than you may first think).

-José

"pigeonrandle" <[email protected]> a écrit dans le message de (e-mail address removed)...
Peter,
Thanks for your input. My dad said i should have been a gardener and
what with the seeds of doubt being planted in my mind, i think i would
have made a good one!

Given my further explanation above do you have anything else you could
add? From what William and José have added, i am beginning to think
that i cant do this with a service (unless a service can spawn an
application without a user being logged in that is...)

Cheers,
James.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top