views:

100

answers:

4

So I am required to write a fairly basic Windows service and have never done so before. Of C#, C++ (the Visual Studio suite), what is the best language to develop in? I am a student, and am most familiar with OO languages such as Java.

Additionally, if anyone can recommend any books, articles, or google searches that would be relevant to the project I would greatly appreciate it.

Thanks!

badPanda

+5  A: 

If you are familiar with Java, I would go with C#. It will be the most similar to what you are used to.

Here are links to Web Services, WCF and Windows Services:

WCF Essentials -- WCF is the recommended technology from MS concerning web services.

Web Services

Windows Services are different than web services, but since you mentioned both, I thought I would include them

Old Windows Service Article

MSDN Link on Windows Services

Windows Service Example

This is an excellent C# book that I would recommend reading: http://www.manning.com/skeet2/

Here are links to WCF MVPS: http://www.danrigsby.com/blog/

Here is a link comparing C# to Java: http://www.25hoursaday.com/CsharpVsJava.html

Kevin
+9  A: 

If it's 1990 or you have extreme performance requirements or need to link with a lot of native code then choose C++.

If it's 2010 and you don't have any unusual requirements then go with C#.

Mark Byers
1990.....that's a good one.
Kevin
It seems that there were enough clients that were requesting C++ web services that Microsoft implemented "Windows Web Services". Performance is important also in 2010, not only in 1990's, read more here: http://msdn.microsoft.com/en-us/magazine/ee335693.aspx
Cristian Adam
+1  A: 

As others have stated, C# is a lot closer to java than C++.

With respect to Web services, which I take to be your focus based on the title and tags of your question, there are two options in .NET, ASMX or WCF.

ASMX web services are the older technology, basically ASP.NET intercepts and processes requests using the ASP.NET stack. These services can be added as a reference in other .NET apps, which generates proxy code to easily access the service. There are also IIS web server extensions that provide security and other functionality. ASMX services have been supplanted by WCF, but are still supported.

WCF is the newer service technology from Microsoft, you can easily configure it to listen on http and use SOAP for transport, and it has all the security and encryption functionality built in. This is a better solution if you potentially want to have your service called by non-.NET clients, or if you may want to reuse your service logic in other non-web applications. There's a little more learning curve, but a lot more power and flexibility.

You should be able to google for tutorials/walkthroughs for both asmx and WCF -- if it is an older tutorial and doesn't say "WCF", it's probably asmx. For WCF services, I have really liked the Service Factory from Microsoft patterns & practices, it gives a lot of good code generation and a designer surface to plan out your services and generates and configures projects to host them.

Guy Starbuck
Hmmm. I greatly prefer the dependency injection pattern when using Java, but Guice isn't available for this, so perhaps Service Factory would indeed be the best choice. Thanks for the recommendation.
badpanda
A: 

I haven't done a lot of networking in C#, but I think Java is have better network components than C#...

If you want to code networking stuff in java, try "TCP/IP Sockets in Java" written by Michael J. Donahoo. which is one of the best book I have ever worked with. And it's very short, yet complete book.

Ankiov Spetsnaz