Programming .NET for cross platform application

  • Thread starter Thread starter Lionel Schiepers
  • Start date Start date
Hello,
We are going to develop our application from scratch.
The application is currently written for WIN32 users only, using MFC.
The requirements asks that the application will run (in the future) on
Windows, MAC and Linux.
Is there any way to write all the code on the .NET Framework, or I should
write the core code in native C++ and write the top level modules (including
GUI) in .NET Framework (using C#), so I can use the core code in the future
on the MAC and Linux?

Thanks,
Janiv Ratson.
 
Janiv said:
Hello, We are going to develop our application from scratch. The
application is currently written for WIN32 users only, using MFC. The
requirements asks that the application will run (in the future) on
Windows, MAC and Linux. Is there any way to write all the code on the
.NET Framework, or I should write the core code in native C++ and
write the top level modules (including GUI) in .NET Framework (using
C#), so I can use the core code in the future on the MAC and Linux?

To be honest, if cross platform is a main requirement, I wouldn't do all
this work-around... I would switch to Java. Then you as a programmer do
not have to worry, if it will run on a certain platform, as Java nearly
runs anywhere... and Java-Applications can be based on SWT and the
Eclipse Platform, which provides already a lot of nice stuff for
applications.

I think, the time of mono & Co will come, but it is not yet that approved...

Additionaly: Just be aware, that you do not exactly know yet, what the
changes with all the new .NET 3.0/winFX stuff will be. You will have to
wait more time until the mono project also has all these implementations
migrated... or might never be able to migrate certain stuff because of
different operating systems.

Using mono or such things is only recommended for small applications,
but on real big projects I would stick to Java or as you proposed to C++
and do only the GUI stuff in .NET for Windows, in Java for Linux and Mac...

Markus
 
Janiv,
The requirements asks that the application will run (in the future) on
Windows, MAC and Linux.

Forget it than with Net. If your requirements ask this and allows you to
spend probably ten times the cost for less than 10% of the desktops, than
let it be and choose something else.

Just my thought,

Cor
 
Your options for cross-platform C# development today are as follows

Windows:
MS .NET
SSCLI
Mono

MAC:
SSCLI
Mono

Linux:
Mono
SSCLI (Argueably as it really runs on BSD)

You can develop for the .NET platform on Windows and Mono on Linux and the
MAC, I do that today. Admittedly, we have run into some issues with Mono,
but only in the cases where we are doing some fancy Generics with .Net 2.0.
I have not personally used the SSCLI on anything but Windows, but I have
heard it makes a great reference platform before deploying to .NET or Mono.

Michael Cummings
Magenic Technologies
 
The big problem with using the SSCLI in anything resembling a production
environment would be the fact that its JIT does *no* optimizing. There are
many similar performance issues with it. It is there as a roadmap to show
how things can be done.

mono on the other hand has a very nice optimizing JIT :)

People like to down play mono but many who do have not looked at it in a
long time. Yes it will be behind the main framework (as they can't start
development on something until MS finishes or atleast releases something)
but they imo have done a very good job catching up. Winforms is just about
functional .. I have loaded up some fairly substantial apps.

The other thing which should be taken into consideration when dealing with
multiple platforms is that people don't like interfaces that are not native
to their environment. This means you will likely end up with multiple front
ends (cooa#, winforms, and GTK#). I personally tend to use MVC/MVP to allow
this up front, but it should atleast be thought of early in the design
process.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung
 
[Wants to build a Cross-Platform .Net application]

You can build cross-platform .Net code using Mono. We've been shipping
product this way for quite some time.

At Coversant, we started with the SoapBox Framework which is an XMPP SDK.
This Sdk provides a network stack suitable for sending and receiving XMPP
stanza's across a socket. This includes technologies such as TLS (and SSL),
SASL, Compression, and Xml. This framework is fully object oriented, using a
large subset of the .Net framework.

The SoapBox Framework runs just find under Mono. Through Mono our framework
runs just about everywhere: Solaris, Linux, AIX, OSX, and a number of other
platforms. It took a little bit of work to make this happen, but it can be
done. We have a single code-base, with a few (probably less than 20) "#if"
sections that do slightly different things.

Server applications and SDK type applications are a good fit for Mono.
There's some tinkering required, but it's not bad.

GUI applications can also run through Mono, although not quite as well. At
this point, our production GUI stuff is only Win32/Win64 and not Mono.

Some pitfalls:
- Mono debugging stinks. There's no good answer.
- Dump file analysis is a joke, which makes building a true production
system difficult.
- Performance Coutners and other Windows related structures don't exist.
- Use C#, don't use VB. The Mono C# compiler is much more mature than the VB
compiler.
 
People like to down play mono but many who do have not looked at it in a
long time. Yes it will be behind the main framework (as they can't start
development on something until MS finishes or atleast releases something)
but they imo have done a very good job catching up. Winforms is just about
functional .. I have loaded up some fairly substantial apps.

I agree. For most things Mono does an excellent job. It's been frustrating
at times, especially with their somewhat patchy .Net 2.0 implementation, but
overall it's very good.

The SoapBox (XMPP sdk, Server, and Client) stuff that we build at Coversant
has run on Mono from the very beginning. We've had some problems with it,
submitted a fair number of bug reports and patches, and been very happy
overall to see it continue to mature.
 
Back
Top