سؤال

I have written a simple RPC class that lets me serialize and send binary data between a .net desktop app and a .net server app. In a nutshell, a client could send:

Dim Message as new TCPMessage
Message.Handler = "NewUser"
Message.AddField("FirstName", "Paul")
Message.AddField("Photo", PhotoBytes)
Message.Send()

And the server would reconstruct the data on the other end:

Public Sub NewUser (Message As TCPMessage)
    Dim FirstName as string = Message.GetString("FirstName")
    Dim Photo() as Bytes = Message.GetBytes("Photo")
    ...
End Sub

This all works OK for what I'm doing at the moment – it seems pretty lightweight and performant.

What I would like to know is, what are the pros/cons of doing this instead through .NET Remoting / WCF? I don’t know much about these technologies, however it would appear that they are a lot more flexible, with the possibility that they may also be less performant and present a considerable learning curve.

On the criteria of performance, learning curve, and bearing in mind that no one else will be maintaining the code, should I continue to build small internal apps using my DIY scheme, or ditch it ASAP for Remoting/WCF?

Edit: Performance is key, the client apps will regularly be receiving datasets of ~200,000 rows (yes, it's absolutely necessary to receive this much data). This is all running on LAN only.

هل كانت مفيدة؟

المحلول

First off, .Net Remoting is now deprecated in favour of WCF, see Does WCF really replace .NET Remoting?

WCF is fast and relatively lightweight. The key benefit of WCF though is that it is so configurable. Making pretty much only configuration changes, you can change serilaization format, transport protocol, authentication mechanism, QOS functionality (reliability/security/scalability). Its also extensible enough that if it doesn't provide what you need you can add it yourself. Finally it abstracts application code from communication code.

I'd definately use WCF for new projects. Would I change an existing application from a stable, performant, custom built solution? That depends on the extent of the change, the drawbacks of the existing solution and the potential benefits wcf could bring.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top