By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,742 Members | 2,026 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,742 IT Pros & Developers. It's quick & easy.

Should I write a service?

P: n/a
Hi all. I hope someone can give me a few pointers on 'best practice' for an
app I'm about to start.

I'm writing a small and simple label design application, users will define
text fields on the label in a GUI, some data may come from a database.

The application will be able to connect to any standard database in time,
but for the time being it's access.

I will need to 'bolt' this application into many other applications as time
goes by, these applications will all require label printing functionality,
but I don't want to include the designer code everytime, so I'll just add
the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I don't
want the designer to load, so I need something sitting in the background
that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder location for
print requests, or create a service that will do the polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.
Oct 26 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a


"TClancey" <tu**@idcodeware.co.ukwrote in message
news:Xd********************@bt.com...
Hi all. I hope someone can give me a few pointers on 'best practice' for
an app I'm about to start.

I'm writing a small and simple label design application, users will define
text fields on the label in a GUI, some data may come from a database.

The application will be able to connect to any standard database in time,
but for the time being it's access.

I will need to 'bolt' this application into many other applications as
time goes by, these applications will all require label printing
functionality, but I don't want to include the designer code everytime, so
I'll just add the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I don't
want the designer to load, so I need something sitting in the background
that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder location
for print requests, or create a service that will do the polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.
To pass data to an exe is as simply as "shelling out" and executing the
command. For something like a service, though, is probably a bit harder.
Something that can be done is have a configuration file somewhere on the
local machine, and have the service read this configuration file (XML good
choice, IMO), and go from there. <shrugjust an idea :)

HTH,
Mythran
Oct 26 '06 #2

P: n/a
Yeah, this is kind of what I'm thinking. I also think a service may be a
little over the top for this app, it doesn't have to be running all the
time.

Cheers,
Tull.

"Mythran" <ki********@hotmail.comwrote in message
news:ea****************@TK2MSFTNGP05.phx.gbl...
>

"TClancey" <tu**@idcodeware.co.ukwrote in message
news:Xd********************@bt.com...
>Hi all. I hope someone can give me a few pointers on 'best practice' for
an app I'm about to start.

I'm writing a small and simple label design application, users will
define text fields on the label in a GUI, some data may come from a
database.

The application will be able to connect to any standard database in time,
but for the time being it's access.

I will need to 'bolt' this application into many other applications as
time goes by, these applications will all require label printing
functionality, but I don't want to include the designer code everytime,
so I'll just add the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I
don't want the designer to load, so I need something sitting in the
background that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder location
for print requests, or create a service that will do the polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.

To pass data to an exe is as simply as "shelling out" and executing the
command. For something like a service, though, is probably a bit harder.
Something that can be done is have a configuration file somewhere on the
local machine, and have the service read this configuration file (XML good
choice, IMO), and go from there. <shrugjust an idea :)

HTH,
Mythran


Oct 26 '06 #3

P: n/a
Tull,
As Mythran suggests having the UI tell the service what to do can be tricky.

In addition to polling a folder location, you can use .NET Remoting (or the
newer WCF (Windows Communication Foundation)) to have the UI tell the
service to print a label. I would consider .NET Remoting over polling a
folder

In a corporation I would consider using MSMQ (either the System.Messaging
namespace or even the newer WCF over MSMQ) to allow multiple machines to
queue requests for labels to print. MSMQ is especially useful if you have
multiple machines requesting labels, but only one machine/printer printing
said labels.

NOTE: WCF is part of .NET 3.0 due out when Vista ships

..NET 2.0 includes an IpcChannel that allows one to limit .NET remoting to a
single machine.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"TClancey" <tu**@idcodeware.co.ukwrote in message
news:Xd********************@bt.com...
Hi all. I hope someone can give me a few pointers on 'best practice' for
an app I'm about to start.

I'm writing a small and simple label design application, users will define
text fields on the label in a GUI, some data may come from a database.

The application will be able to connect to any standard database in time,
but for the time being it's access.

I will need to 'bolt' this application into many other applications as
time goes by, these applications will all require label printing
functionality, but I don't want to include the designer code everytime, so
I'll just add the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I don't
want the designer to load, so I need something sitting in the background
that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder location
for print requests, or create a service that will do the polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.
Oct 26 '06 #4

P: n/a
Oh! I should add, Do you really need a separate EXE (service or otherwise)
to print a label, I would consider simply including that logic directly in
the same assembly that does the label UI.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"TClancey" <tu**@idcodeware.co.ukwrote in message
news:Xd********************@bt.com...
Hi all. I hope someone can give me a few pointers on 'best practice' for
an app I'm about to start.

I'm writing a small and simple label design application, users will define
text fields on the label in a GUI, some data may come from a database.

The application will be able to connect to any standard database in time,
but for the time being it's access.

I will need to 'bolt' this application into many other applications as
time goes by, these applications will all require label printing
functionality, but I don't want to include the designer code everytime, so
I'll just add the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I don't
want the designer to load, so I need something sitting in the background
that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder location
for print requests, or create a service that will do the polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.
Oct 26 '06 #5

P: n/a
Thanks for the info.

I had thought of Writing the whole package and calling the EXE differently
for design and print mode, but it's likely that the designer will be used
infrequently. I don't want the designer to be doing too much, like polling
in the background, so I think two apps is the way to go.

Again, thanks.
Tull.

"Jay B. Harlow" <Ja************@tsbradley.netwrote in message
news:8B**********************************@microsof t.com...
Oh! I should add, Do you really need a separate EXE (service or otherwise)
to print a label, I would consider simply including that logic directly in
the same assembly that does the label UI.

--
Hope this helps
Jay B. Harlow
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"TClancey" <tu**@idcodeware.co.ukwrote in message
news:Xd********************@bt.com...
>Hi all. I hope someone can give me a few pointers on 'best practice' for
an app I'm about to start.

I'm writing a small and simple label design application, users will
define text fields on the label in a GUI, some data may come from a
database.

The application will be able to connect to any standard database in time,
but for the time being it's access.

I will need to 'bolt' this application into many other applications as
time goes by, these applications will all require label printing
functionality, but I don't want to include the designer code everytime,
so I'll just add the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I
don't want the designer to load, so I need something sitting in the
background that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder location
for print requests, or create a service that will do the polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.

Oct 30 '06 #6

P: n/a
Tull,
Designer aside.

What I am asking is the why does the act of printing need to defer to
another application.

If Application1 says "print it", why doesn't Application1 simply print it,
why have Application1 queue the request to print it so that Application2
needs to print it.

--
Hope this helps
Jay B. Harlow
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"TClancey" <tu**@idcodeware.co.ukwrote in message
news:p-********************@bt.com...
Thanks for the info.

I had thought of Writing the whole package and calling the EXE differently
for design and print mode, but it's likely that the designer will be used
infrequently. I don't want the designer to be doing too much, like
polling in the background, so I think two apps is the way to go.

Again, thanks.
Tull.

"Jay B. Harlow" <Ja************@tsbradley.netwrote in message
news:8B**********************************@microsof t.com...
>Oh! I should add, Do you really need a separate EXE (service or
otherwise) to print a label, I would consider simply including that logic
directly in the same assembly that does the label UI.

--
Hope this helps
Jay B. Harlow
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"TClancey" <tu**@idcodeware.co.ukwrote in message
news:Xd********************@bt.com...
>>Hi all. I hope someone can give me a few pointers on 'best practice'
for an app I'm about to start.

I'm writing a small and simple label design application, users will
define text fields on the label in a GUI, some data may come from a
database.

The application will be able to connect to any standard database in
time, but for the time being it's access.

I will need to 'bolt' this application into many other applications as
time goes by, these applications will all require label printing
functionality, but I don't want to include the designer code everytime,
so I'll just add the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I
don't want the designer to load, so I need something sitting in the
background that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder location
for print requests, or create a service that will do the polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.

Oct 30 '06 #7

P: n/a
If the designer app were the only printing app then this is how I would do
it.

The designer is a basic attempt to add an exe to any project that I may
write, with the designer the users can create their own label formats.
'Mostly' the print requests will come from other applciations.that this exe
has been bundled with.

I've toyed with the idea of calling the Design app with data to print,
therefore avoiding the design environment, but it is also possible that the
designer may not be present and simple label printing from the host app is
all that is required.

With this complexity in mind I have decided to go with a 'print engine' that
can be called as and when required.

Of course, if you think I'm completely barking, please let me know, I'm more
than happy to try things before settling.

Cheers,
Tull.

"Jay B. Harlow" <Ja************@tsbradley.netwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Tull,
Designer aside.

What I am asking is the why does the act of printing need to defer to
another application.

If Application1 says "print it", why doesn't Application1 simply print it,
why have Application1 queue the request to print it so that Application2
needs to print it.

--
Hope this helps
Jay B. Harlow
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"TClancey" <tu**@idcodeware.co.ukwrote in message
news:p-********************@bt.com...
>Thanks for the info.

I had thought of Writing the whole package and calling the EXE
differently for design and print mode, but it's likely that the designer
will be used infrequently. I don't want the designer to be doing too
much, like polling in the background, so I think two apps is the way to
go.

Again, thanks.
Tull.

"Jay B. Harlow" <Ja************@tsbradley.netwrote in message
news:8B**********************************@microso ft.com...
>>Oh! I should add, Do you really need a separate EXE (service or
otherwise) to print a label, I would consider simply including that
logic directly in the same assembly that does the label UI.

--
Hope this helps
Jay B. Harlow
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"TClancey" <tu**@idcodeware.co.ukwrote in message
news:Xd********************@bt.com...
Hi all. I hope someone can give me a few pointers on 'best practice'
for an app I'm about to start.

I'm writing a small and simple label design application, users will
define text fields on the label in a GUI, some data may come from a
database.

The application will be able to connect to any standard database in
time, but for the time being it's access.

I will need to 'bolt' this application into many other applications as
time goes by, these applications will all require label printing
functionality, but I don't want to include the designer code everytime,
so I'll just add the EXE and DLL's required to the install set.

The problem starts when the user actually wants to print a label. I
don't want the designer to load, so I need something sitting in the
background that will pick up the print instructions.

I'm thinking that I need a seperate EXE that will poll a folder
location for print requests, or create a service that will do the
polling.

Where my knowledge ends is passing data to an EXE or a Service, not
something I have had to do before.

Can anyone share any experiences of this kind of thing?

Cheers,
Tull.



Oct 31 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.