thukralz

I don't know if this question belongs here, its more of conceptual question.

What is the use of Windows Services

I have a business layer and a data layer which has to somehow run with that service and have a client application that will call that and do some functions. How can I accomplish this task

Any examples or tutorials, highly appreciated.

Thanks,

Harsimrat



Re: Visual C# General Question about Windows Services ??

frederikm

Hi

the value of a windows service is that it is an application that is running continuously,
without the need for any user interaction (automatic startup) and mostly not even a user interface
typically, you would have your service on a server box ..

the functionality can be anything really, a data layer or a business layer

for instance you have a client which calls your datalayer service (over .net remoting and whatnot ) to save an object...

Have a look at the following

http://msdn2.microsoft.com/en-us/library/aa983583(VS.71).aspx
http://msdn2.microsoft.com/en-US/library/system.serviceprocess.servicebase.aspx

Hope this helps you out, please close the thread if it does






Re: Visual C# General Question about Windows Services ??

Ross Dargan

Hi, I have written a blog entry about windows services you might find interesting:-

http://blog.the-dargans.co.uk/2007/01/windows-services.html

I mainly use windows services on servers where a user interface would make little sense. You usually use them to check for something occurring/a trigger like a file added somewhere it shouldn¡¯t have been.

It is both business layer and data layer potentially, but never presentation (bar the output to the event log!).

I hope this answers your question.

Ross (http://Blog.the-dargans.co.uk)






Re: Visual C# General Question about Windows Services ??

Harsimrat

I have been through your blog before, say if something is running as a service on Windows Terminal Services and that is also connecting to the database and other good stuff. What is the advantage over when client can use the same dll and call the database from there, rather than running as a service.This part is little confusing to me...

Say Business layer and services are two different projects or they can be done in one....as my application lot of clients will be connecting to the service....





Re: Visual C# General Question about Windows Services ??

frederikm

Hi

the real advantage here would be that your business logic is contained in one place...

so, if your business logic would change you would only have to change the service, instead of all the clients






Re: Visual C# General Question about Windows Services ??

Harsimrat

can you give me a little code setup to use the service and the business layer say even adding two numbers that way....some example like that will help me understand more...

I'm still looking should my service project call the business layer or I should have it as one project....





Re: Visual C# General Question about Windows Services ??

frederikm

hi

take a look at the .net remoting example below
http://msdn2.microsoft.com/en-us/library/3tzky0f2.aspx

.net remoting being one of the possibilities of communication with the server

Hope this helps you out, please close the thread if it does