On Jan 20, 6:49 am, Stuart Carnie <
stuart.car...@gmail.com> wrote:
> Good work, and thanks for the contribution.
>
> I prefer to take a different approach, and maintain binary
> compatibility between platforms for the core application logic.
Hm... that's the approach I took. The StupidWordCounterModel class
does all the actual application logic and StupidWordCounter speaks to
the GUI.
> There
> is no conditional compilation in my example, just a single piece of
> configuration to indicate which 'GUI' to use.
How did you solve the problem of different GUIs? I have two different
implementations of the controller class, one for Winforms, one for
Cocoa.
> I take a model-view-
> controller approach, which allows the views to be separated out as an
> interface (such as IWordCounterView).
I have a model class and a controller class.
> I have a working example for Cocoa, but will redo the example, using
> your word counter, to demonstrate the differences in the approach and
> a single set of binaries that run on Windows and OS X without
> modification. I will finish it off and post an article in the next
> week or so.
Excellent.
But I didn't know it was possible to combine the two into one binary.
My Windows Forms binary does run on Windows and Mac OS, of course.
I suppose checking for the underlying OS is possible, but how do you
do a "using Cocoa;" without making the compiler complain?