macos:Interoperability
出自UXGuide.net
请帮助我们修订和更新本文的中文部分
本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划。
互操作
Interoperability
Interoperability refers to a program’s ability to communicate across environments. This communication can occur at either the user or the program level and can involve processes on the current computer or on remote computers. At the program level, an interoperable program supports ways to move data back and forth between itself and other programs. It might therefore support the pasteboard and be able to read file formats from other programs on either the same or a different platform. It also makes sure that the data it creates can be read by other programs on the system.
互操作指程序和环境交互的能力。这种交互可以发生在用户身上也可以发生在程序身上。可以和当前计算机的进程也可以和远程计算机的进程交互。在程序级别,一个可互操作的程序意味着支持和其他程序交换数据。程序支持剪贴板,可以从相同平台或者不同平台的程序中读入不同格式的文件,并可以确保自己创建的数据能够被系统其他的程序读取。
Users see interoperability in features such as the pasteboard (the Clipboard in the user interface), drag and drop, AppleScript, Bonjour, and services in the Services menu. All these features provide ways for the user to get data into or out of an application.
用户可以从粘贴版,拖拽,AppleScript,Bonjour以及服务菜单项中的服务来获知程序的互操作性。所有的这些功能都向用户提供了 在程序外获取数据的方式。
Here are some guidelines to keep in mind as you design your software for interoperability:
下面是在设计过程中关于互操作性的一些准则:
- Avoid custom file formats whenever possible to ensure that users can easily exchange documents with users of other programs. If you must use custom file formats, provide import and export capabilities to allow users to exchange data with other applications.
- 避免使用自定义的文件格式,从而让用户可以方便的和其他程序的用户交换文档。如果您必须使用自定义的文件格式,则提供导入和导出的功能以允许用户和其他的程序交换数据。
- Use the same file format on all supported platforms. Make sure documents created by your application on one platform can be read by your application on other platforms.
- 在所有支持的平台上使用同样的文件格式。确保在一个平台上您的程序创建的文件能够在另外一个平台被您的程序打开。
- Support filename extensions to ensure that users on other platforms can recognize and open your files. See File System Overview for more information on the importance of filename extensions.
- 支持文件扩展名以确保其他平台的用户能够识别和打开您的文件。文件扩展名的更多信息请参考文件系统概述。
- Use standard protocols for data interchange whenever possible. XML is a preferred format for exchanging data among applications and platforms because it is cross-platform and widely supported. Mac OS X also supports numerous network protocols, as listed in Mac OS X Technology Overview.
- 尽可能的使用标准的协议来进行数据交互。XML是数据交互首选的格式,因为它可以跨平台并且被广泛支持。Mac OS X同样支持大量的网络协议,见Mac OS X技术概述。
- Save configuration data using the Mac OS X preferences system implementations offered by Cocoa and Core Foundation. These implementations store configuration data in plain-text files, which gives the user the opportunity to modify the data either directly or with a script.
- 使用Cocoa和Core Foundation提供的Mac OS X配置系统实现来保存配置数据。这些实现将配置数据保存为纯文本文件,从而让用户可以直接或者通过脚本来修改这些数据。
- Design your AppleScript object model carefully to allow for flexibility and future expansion. Good AppleScript integration requires some thought as to how users or other programs might interact with your data. It also requires careful integration with your program’s data structures. See Scripting Interface Guidelines for more information.
- 仔细设计您的AppleScript对象模型以具有灵活性和扩展性。良好的AppleScript集成需要考虑用户和其他程序可能怎样和您的数据交互,同时也需要对您的程序的数据结构进行集成。更多信息请参考脚本接口设计指南。
For more information on how to leverage Mac OS X features and technologies in your application, see “[[macos:using-mac-os-x-technologies|Using Mac OS X Technologies].”
关于在程序中使用Mac OS X功能和技术的更多信息,请参考 “使用Mac OS X技术。”