macos:Mobility
出自UXGuide.net
请帮助我们修订和更新本文的中文部分
本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划。
移动性
Mobility
Designing for mobility has become increasingly important as laptop usage soars. A program that supports mobility doesn’t waste battery power by polling the system or accessing peripherals unnecessarily, nor does it break when the user moves from place to place, changes monitor configurations, puts the computer to sleep, or wakes the computer up.
随着手提电脑的使用,对移动性的支持变得越来越重要。一个良好支持移动性的程序既不会轮询系统或者作不必要的访问来浪费电池,也不会在用户移动,显示器更改,计算机睡眠或者计算机唤醒时崩溃。
To support mobility, programs need to be able to adjust to different system configurations, including network configuration changes. Many hardware devices can be plugged in and unplugged while the computer is still running. Mobility-aware programs should respond to these changes gracefully. They should also be sensitive to issues such as power usage. Constantly accessing a hard drive or optical drive can drain the battery of a laptop quickly. Be considerate of mobile users by helping them use their computer longer on a single battery charge.
为了支持移动性,程序需要能够适应不能的系统配置,包括网络配置的改动。在计算机运行时,可能有很多硬件插入或者拔出。支持移动性的程序必须合适的响应这些变化。这些程序还必须考虑电源的使用。长时间的访问硬盘或者光驱将很快用光手提电脑的电池。这些程序需要为移动用户考虑,帮助他们的电脑在一块电池的情况下运行的时间更长。
Here are some guidelines to keep in mind as you design your software to support mobility:
下面是设计过程中关于移动性的一些准则:
- Avoid polling for events. Polling the system needlessly wastes CPU time, which in turn wastes battery power on portable systems. Most modern APIs have ways of notifying your program when something interesting happens. Register to receive these notifications and respond to them as appropriate; otherwise (if your program has nothing to do), it should be completely idle.
- 免轮询事件。无谓的轮询系统将浪费CPU时间,在移动平台上就是浪费电池。很多新的API都提供了在您感兴趣的事件发生时通知您的功能。您可以在系统注册以接受这些通知并响应这些通知,否则(如果您的程序没什么要做的话),程序应该是完全空闲的。
- Try not to require that the user insert the program CD when using your software. Give the user an option to install everything on a local hard drive.
- 不要强迫用户必须插入光盘才能运行您的程序。您应该给用户提供选项,以把一切都安装在本地的硬盘上。
- Minimize access to files on the hard drive or on an optical drive. In addition to improving performance, you can reduce battery consumption by letting the drives spin down more frequently.
- 减少对硬盘和光驱上文件的访问。这样不仅能提高程序的性能,也能够减少电池的消耗。
- Use modern networking interfaces to adapt to network configuration changes. Mobile users may change locations or wireless access points at any time. Use CFNetwork and other modern interfaces to handle these configuration changes for you.
- 使用新的网络接口API来适应网络配置的变化。移动用户可能在任何时候更改位置和无线接入点。使用CFNetwork和其他的新的网络接口API来处理这些变化。
- Be forgiving when accessing the file system, in case network volumes go offline. If a network volume disappears, notify the user and provide an option to save files to a different volume.
- 访问文件系统时提供一定的容错度。当网络卷断线时。通知用户并且提供将文件保存到其他卷的选项。
- Be sensitive to screen resolution changes and the plugging in and unplugging of monitors. Mobile users may need to plug in a projector or other device that requires a different resolution, so do not assume a fixed screen size in your software. If a monitor disappears, adjust the position of any windows that were on that monitor so that they remain visible.
- 检测屏幕分辨率的改动和显示器的插入及拔出。移动用户可能会连接不同分辨率的投影仪或者其他设备,所以不要在您的软件中总是假设一个固定的分辨率。如果一个显示器不可用了,调整那个显示器上所有窗口的位置以让这些窗口仍然可见。