跨平台开发 - 使用跨平台UI工具包或本地多平台? [英] Cross-platform development - Go with a cross-platform UI toolkit or native on multiple platforms?

查看:137
本文介绍了跨平台开发 - 使用跨平台UI工具包或本地多平台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一些论据来向我的老板和同事开发者。



我们目前正在完成初步UI模型,并准备进入下一阶段的开发阶段。在此期间,我一直在挖掘Carbon,Win32和wxWidgets API的深度,试图使一些控件在Mac和Windows平台上具有更原生的外观和感觉。



越多的我挖掘Win32和Carbon API来实现我们想要的项目的UI,他们感觉越老,我开始认为我们应该按照最后一段所述实施项目这里



我们正在为当前项目使用wxWidgets。 wxWidgets正在wxCocoa端口上,但它看起来不会准备好的黄金时间,我们开始在我们的新应用程序的主要开发工作之前。在Windows端的东西,它包装Win32 API而不是WinForms或WPF(可能是由于本机VS托管代码)。



我们已经设计系统与MVC模式的思想,因此除了必须写两个本机UI,它应该是非常可行的,和IMHO,更容易获得所需的UI效果使用现代API,如Cocoa和WPF。



我一直在努力推广这些点,但主要开发的开始即将到来。有没有人有任何建议如何使用原生的UI工具包在我们的下一个应用程序vs使用wxWidgets?



提前感谢。


<在Cocoa中使用Objective-C ++在Mac和C ++ / CLI上创建您的用户体验,并使用WPF创建您的用户体验,以创建您的用户在Windows上的体验。按照Mac版本的Mac平台指南,Windows版本中的Windows版本,甚至不必考虑尝试共享用户界面代码。



一个好的管理方法是,而不仅仅是Model-View-Controller,遵循Model-Model Controller-View Controller-View架构。您的型号控制器是与平台无关的,并且可以管理应用程序的更高级功能。 (例如,其整个文档概念,文件格式,作业队列等等)。您的视图控制器是依赖于平台的,并且在您的模型控制器和您的用户体验之间进行调解。



当然,你可能还需要一些在平台相关的代码在模型层面上;例如在Mac上使用NSOperation并在Windows上使用线程池来实现作业队列。只需为这种事情创建自己的轻量级抽象。


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 the next phases of development. In the meantime, I've been digging through the depths of the Carbon, Win32, and wxWidgets APIs attempting to make some of the controls have a more native look and feel on the Mac and Windows platforms.

The more I dig into the Win32 and Carbon APIs to implement the things we want in our project's UI, the more antiquated they feel, and the more I'm beginning to think that we should be implementing the project as described in the last paragraph here.

We're using wxWidgets for our current projects. wxWidgets is coming along on the wxCocoa port, but it doesn't look like it's going to be ready for prime-time before we start major development efforts on our new application. On the Windows side of things, it wraps the Win32 API rather than WinForms or WPF (likely due to native vs. managed code).

We're already designing the system with the MVC pattern in mind, thus aside from having to write two native UIs, it should be very doable, and, IMHO, easier to get the desired UI effects using modern APIs such as Cocoa and WPF.

I've been trying to push these points subtly, but the start of major development is coming soon. Does anyone have any suggestions on how to pitch using native UI toolkits in our next application vs sticking with wxWidgets?

Thanks in advance.

解决方案

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.

这篇关于跨平台开发 - 使用跨平台UI工具包或本地多平台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆