I have a WPF application, that I want to port to Linux/Mac. The most logic way seems to split t开发者_如何学运维he application in two parts: client and server, and use Silverlight for the client UI, and run the server-part (as an invisible console-app) in Mono.
But what's the best way to let those two parts communicate? Silverlight 4 supports COM interop, but I cant use that because it will fail in Moonlight. So I was thinking about socket-connection to localhost, and use JSON or something similar. Or is there a better way which doesn't require me to write dozens of wrappers for all the function contained in the server-dll? Because communication will be between Mono<>Moonlight, maybe i can use something similar as COM interop that is cross-platform?
maybe you can consider to use Eneter Messaging Framework.
It allows to implement the communication between Silverlight and standalone application based on Tcp. The low level communication is hiden and the framework is very easy to use.
You can see the following example:
http://eneter.blogspot.com/2010/07/silverlight-interprocess-communicatin.html
You're on the right track.
You should create a web server application and the Silverlight app would communicate with it over http://localhost via REST or SOAP.
Joshua - I'm a bit confused (and I don't mean that in a negative way). If the app runs on the users machine then isn't there's no "server" to connect with?
What's the nature of the server-side components? - what do they do? Can't you just run the whole thing from within SilverLight?
SilverLight is providing the runtime host for .Net, in that sense it can contain your whole app - which can still be layered like a "conventional" web-based solution, so you can still have separate assembilies for Business Logic, etc.
精彩评论