osx - Advice for supporting both Mac and Windows Desktops -


what best practices building gui desktop app support both windows , os x? let's it's budgeting software, there bit of math , big data structures. user data saved in xml files; there no separate database or networking.

at 1 extreme, build windows version in c# , mac version in objective c. there better approach, can more keep 2 versions in sync , write less duplicate code? write math , data structures , "business logic" in c++, pre-processor directives simple system calls io, , separate gui layer written once windows , once os x? c/c++ choice cross-platform end, assuming want native code? there way write gui part single time? (i expect not.)

please note i'm not asking how use cross-compiler. i'm interested in how you'd structure overall project least hassle.

it's have different view on issue, given strong feelings platform native user interfaces , controls/widgets, tend prefer second approach. i'm not masochistic enough go through hassle of building entire application separately.

so definitely write library or data layer code entirely separate gui layer. doing in c++ obvious choice, if you're comfortable language, more on later. point code should limited "business logic", , platform independent. if follow solid object-oriented principles, should work out bulk of programming work done on level.

separately that, write thin, "wrapper" library on core os , ui functions both windows , os x. wrapper library sole entity responsible directly interacting platform, , data layer code should call functions wrapper library, rather directly platform's api.

of course, several of reading screaming "but that's qt you!" yeah, know. doesn't use native widgets, , doesn't conform standard platform conventions in so many places. means sucks. i've seen other wrapper libraries windows do right, i've yet see 1 on os x looked halfway decent. yes, i'm picky, typical mac user. won't put type of garbage on screen windows users will, , mac office team knows this. (we collectively applaud trying right.)

as far choice of languages, looking native code on both platforms. that's pretty difficult blob of jelly pin wall. example, consider jit-complied code native? if not, rules out c#. excluding type of interpreted code rules out host of other potential languages. aren't left many options other c++ , objective-c. c++/win32 programming isn't more difficult cocoa programming, different.


Comments

Popular posts from this blog

Delphi Wmi Query on a Remote Machine -