Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mono - sharing code on client and server . .

We are trying to come up with our client and server standard and there is a big debate. One school of thought is C# client and java servers using some type of proprietary messsage library to share data objects (think XML like structure . .)

The issue with this model is that there is lots of code that needs to be duplicated (validation, parsing) that could simply be reused if you went with C# on the server as well. If there is a big push to use linux machine then wouldn't mono support your goal . .

anyone else have this dilemma?

like image 473
leora Avatar asked Dec 12 '25 22:12

leora


2 Answers

There are frameworks for this. ICE (ZeroC), "protocol buffers", etc.

For example, my protocol buffers implementation (protobuf-net) works on mono, MS .NET, CF, Silverlight etc - and the binary format is compatible with a range of languages (java, etc). If you start from a .proto (a bespoke definition language), you can use it to generate the object layer in each language you need.

like image 66
Marc Gravell Avatar answered Dec 15 '25 14:12

Marc Gravell


In any case I would use Protocol Buffers or something else defined in a language neutral form for the comms, to ensure that you aren't restricted in future.

Once you've done that you can start with C# on Mono. And then if that proves to be unworkable, you can switch to a different language.

like image 41
Douglas Leeder Avatar answered Dec 15 '25 16:12

Douglas Leeder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!