Web Service vs C# Dll

G

Guest

Hi Al

I would just like to know, When I am developing my C# Windows application, would it be better for me in the long run, to make Web services instead of DLL's so that when/if eventually we have a Web application that needs the same functions, it will be easier to integrate this web service, or should I rather create a DLL for the C# application and a web service for the Web application? Are there any differences between the webservice and a DLL like performance degradation etc

Thanks in advanc

Bob
 
K

Klaus H. Probst

Implement the functionality in a standalone assembly and design it so that
it can be controlled from a GUI using public classes/methods. That will set
you up for alternative front ends, like web services. Build your initial
WinForms client around the DLL.

There's little or no performance degradation.

--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

Bob said:
Hi All

I would just like to know, When I am developing my C# Windows application,
would it be better for me in the long run, to make Web services instead of
DLL's so that when/if eventually we have a Web application that needs the
same functions, it will be easier to integrate this web service, or should I
rather create a DLL for the C# application and a web service for the Web
application? Are there any differences between the webservice and a DLL like
performance degradation etc.
 
B

Ben Rush

Bob,

If I understand you correctly when you say, "performance degredation"
meaning "is there a penalty for" then, yes, there is a performance penalty
for using a WebService over a DLL which resides on disk. WebServices require
marshalling of data, SOAP calls and the like, whereas your on-disk DLL, once
JITTed, has literally no penalties in comparison to native code.

Build it as a DLL.


Bob said:
Hi All

I would just like to know, When I am developing my C# Windows application,
would it be better for me in the long run, to make Web services instead of
DLL's so that when/if eventually we have a Web application that needs the
same functions, it will be easier to integrate this web service, or should I
rather create a DLL for the C# application and a web service for the Web
application? Are there any differences between the webservice and a DLL like
performance degradation etc.
 
B

Ben Rush

I may not necessarily be the best person to answer this, but in my opinion
the best time to write a webservice is when you're trying to create a
cross-platform solution, or a solution that already has, say, a web and
client-side implementation.

I don't see it difficult to take the same assemblies that you use for
building your Windows application and use them to power the web-service in
the future. I also don't see any reason for your clientside app to take the
performance hit (and the necessity to be online) when there doesn't exist a
web application on the possibility that there may be one someday.

Ben
 

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