views:

134

answers:

2

Hi,

I'm trying to build a dual platform application for a company of my own I'm trying to start at night.

I have the .NET version done, but have not finished the UI part. I'm thinking of buying some 3rd party controls.

If I buy these controls, however, they clearly will only work in my Windows version. I'm wondering if I should try to do the UI in GTK# and use Mono with CocoaSharp or just build the thing in MS technology and teach myself the Mac side?

I'm just really unfamiliar with the Mac world and am wondering how much of a learning curve there might be.

I've thought perhaps of rewriting my core logic in Ruby or Python. This why I could use the .NET version with .NET controls and presumably hook the same code up on the Mac.

It's an educational app targeted at consumers. As such, it shouldn't require a lot of technical sophistication to install.

+3  A: 

Avoid using cross platform UI tools; the result will never be as good as a native implementation, which is especially bad on the OS X where most customers expect a certain level of polish in their applications. Implementing the core logic in a platform independent language like C++ and maintaining a different code base for the interface on each platform can be a good solution, especially if you have a very complex model.

Anyway, you shouldn't have too much difficulty learning Cocoa if you're a good .NET programmer; I did the reverse several years ago and didn't have much trouble. Objective-C is more C oriented than C#, but if you know the basics about pointers and such you're going to be okay. Cocoa and .NET definitely have their differences in certain areas, but they're both high level frameworks which you shouldn't have too much trouble understanding. Get a good book (Hillegass is the go-to author) and go through it so you understand how the two APIs use different design patterns in certain areas, and don't try to fight the framework if it's different than what you're used to.

In my experience this will make you a better programmer in the long run by expanding your knowledge, even if you don't write any more Cocoa applications.

Marc Charbonneau
+3  A: 

If the non-visual part of the .NET application is quite big compared to the UI, then you can go full .NET and adopt the following two-steps strategy:

  1. Non-Visual Part

    • Develop the non-visual .NET part to be the most platform independent.
    • Platform dependent code for non-visual code should be isolated in small classes that provide the same interface so they could be plugged according to the platform.
  2. User Interface

    • Use System.Windows.Forms (or your favorite toolkit) for Windows
    • Use a Cocoa bridge (see this page for the choices) for Mac OS X.

You still can benefit from learning Objective-C: as the Cocoa bridges are usually heavily based on the Apple's API, you will find a lot of help in the Apple's sample code (which are in Objective-C).

On Windows, the application will run with the Microsoft .NET runtime and on Mac OS X, the application will run with the Mono runtime.

The DeepMeta application uses this strategy. As you can see the user experience is quite good on both platforms.

Laurent Etiemble