Cross-platform development - Go with a cross-platform UI toolkit or native on multiple platforms?

后端 未结 8 1318
灰色年华
灰色年华 2020-12-30 17:06

I\'m looking for some arguments to pitch to my boss and fellow developers.

We\'re currently finishing up the preliminary UI mockups and getting ready to move on to

8条回答
  •  情话喂你
    2020-12-30 18:00

    Create your core code in Standard C++ and use Objective-C++ with Cocoa to create your user experience on the Mac and C++/CLI plus C# with WPF to create your user experience on Windows. Follow the platform guidelines for the Mac in your Mac version, for Windows in your Windows version, and don't even bother thinking about trying to share user interface code.

    One good way to manage this is, instead of just Model-View-Controller, following a Model-Model Controller-View Controller-View architecture. Your Model Controllers are platform-independent and manage the higher-level functionality of your application. (For example, its entire concept of documents, file format, job queues, and so on.) Your View Controllers are platform-dependent and mediate between your Model Controllers and your user experience.

    Of course you'll probably also want some platform-dependent code at the model level too; for example to use NSOperation on the Mac and thread pools on Windows to implement job queues. Just create your own lightweight abstractions for that sort of thing.

提交回复
热议问题