[Windows]_[专家组:对构建WinRT程序的微软开发者的答疑]

来源:互联网 发布:手机进货软件 编辑:程序博客网 时间:2024/04/29 17:15

原文: http://www.infoq.com/news/2012/11/Panel-WinRT-Answers




Panel: Answers from Microsoft Developers Who Built WinRT

专家组:对构建WinRT程序的微软开发者的答疑


Chris Anderson,Chris Guzak,Jerry Dunietz,Kamen Moutafov,Martyn Lovell,Elliot H Omiya, lead developers working on various WinRT components, have taken questions during the BUILD 2012 panelThe Windows Runtime Q&A, answering some of the developers’ ardent questions on Windows 8 applications, especially WinRT ones. Following is a digest of the answers to most important questions.

Chris Anderson, Chris Guzak, Jerry Dunietz, Kamen Moutafov, Martyn Lovell, Elliot H Omiya是首席开发人员,他们负责各种WinRT组件的开发,携带着一些问题和 Windows Runtime Q&A在BUILD 2012上回答了一些开发者在Window 8应用程序上遇到的激烈的问题,特别是WinRT这类.紧接着是对那些最重要问题的回答总结。

There is one CLR, one set of DLLs, for desktop and Windows Store applications, but a desktop application’s calls do not go the path of WinRT.

有一个CLR,是一组DLLs,用于桌面和Windows Store应用程序,但是桌面应用程序的请求不会经过WinRT这层.

WinRT asynchronous calls may create a problem for cases when, for example, someone has to check the name of hundreds of files. An exception is thrown for
each call making the debugging experience cumbersome. The team considers solving this problem in the future.

WinRT的异步请求也许给一些情况制造了一个问题,例如,某人不得不检查上百个文件的名字.对于每个请求会有一个异常抛出,让调试体验非常糟糕.这个团队考虑在未来会解决这个问题.

Microsoft is not disclosing any information regarding future versions of .NET or WinRT, but they will do that at some point in the future. All that they can say right now is the “Windows 8 has a version of WinRT in it.”

Microsoft 不会公开任何关于未来.NET或WinRT版本的信息,但是他们在未来某些点会公布一些.他们现在只能说的就是"Window 8 会有一个新的WinRT版本"

Opening a file by a Windows Store app will fail if the file is already opened by a desktop app in exclusive mode. To avoid such a conflict one needs to open the
file in read mode. The underlying file system is common to both WinRT and desktop apps.

如果一个文件已经被桌面程序以独有模式打开,那么通过Windows Store app打开会失败.为了回避这个问题,我们需要以只读模式打开.基本的文件系统是适用于WinRT和桌面程序的.

An async operation is executed on a separate thread that comes from a dedicated thread pool administered by Windows. Care must be taken when firing a large
number of asynchronous calls from the UI thread because they can have a severe impact on the application when they all come back. If an application is to run
many async calls, then it is recommended to batch their execution so it won’t overload the system.

一个异步操作会在一个分离的线程里执行,这个线程来自于一个被Windows管理的专有的线程池.必须小心这种情况,当从UI线程发出一个大数量的异步请求时,因为他们所有都返回时会对程序产生一个严重的影响.如果一个程序准备运行许多异步请求,那么推荐把他们的执行打包(batch their execution)以防止系统过载。

There is a new type of string in WinRT in order to have a common way that supports the needs of various languages targeting WinRT. A string created in a
language -C#, C++, JavaScript, etc. - is not automatically duplicated when passed to WinRT, only a reference is passed for performance reasons, but it can
be duplicated when necessary.

在WinRT里有一种新的字符串类型,是为了有一种通用的方法来支持各种语言的需求。这个string可在C#,C++,Javascript等里创建.当它被传递到WinRT时,字符串不会自动复制,由于性能的原因仅仅是传递了一个引用,但是它在需要的时候也能复制.

The Windows Store certification process covers only the basic tests to ensure an application’s compatibility with WinRT devices, such as Surface, and it is not
an exhaustive one. Extensive testing needs to be performed in order to ensure an application behaves correctly when run on a target device.

Windows Store认证过程只是覆盖了一些基本的测试来保证程序兼容WinRT设备,例如Surface,它并不是一个详尽的测试。需要执行大量的测试来保证一个程序在目标设备运行时行为是正确的。

Microsoft is not providing programmatic access to some of the system’s hardware information – such as the battery level - in WinRT to avoid developers use it to
change the application’s behavior based on that. The idea is to let applications have a consistent behavior across devices and system states. The Windows 8 Dev
Portal provides some information regarding the devices and Windows versions an application runs on.

Microsoft不准备提供程序访问系统硬件信息的能力,例如电池级别-在WinRT是为了回避开发者使用它来改变基于它的应用程序的行为。这个想法是让应用程序在跨设备和系统的情况下有一致的行为。

It is hard or impossible to write system administration type of applications for WinRT. The system prohibits or limits access to certain system resources.

为WinRT写一些系统管理类型的程序是很难或不可能的。因为系统阻止或限制了访问特定的系统资源。

There is no programmatic way to query or enforce the application that will serve a certain protocol, such as the file protocol setting determining which application plays mp3 files. The decision is left to the user.

没有程序办法来查询或强制应用程序(它服务于某个特定的协议),例如文件协议设置决定了哪个应用程序播放mp3 文件.决定权是留给用户的.

Regarding communication between desktop and Store apps, one of the panelists said: “We work hard for that not to work.” The only way to communicate is
through protocols and file type association which are under user’s control.

关于桌面和Store 应用程序之间的通讯,其中一个panelists说:"我们努力去做但是做不了."唯一的通讯办法是通过协议和文件类型关联,但都是在用户控制下的.

A WinRT application can have multiple views running in separate threads. Windows considers 2 such views as one single application, that meaning an user cannot
switch between the views using the system app switching mechanism but a mechanism developed separately for the app.

??这段翻译不好.

A Windows Store application can open ports and communicate but not the web server’s port, 80.

一个Windows Store应用程序能打开端口和通讯,但不是web server的80端口.
原创粉丝点击