预计阅读本页时间:-
Chapter�營nterfaces
User-Interface Design Patterns in爐he燯nix Environment
Table of Contents
广告:个人专属 VPN,独立 IP,无限流量,多机房切换,还可以屏蔽广告和恶意软件,每月最低仅 5 美元
Applying the Rule of Least Surprise
History of Interface Design on Unix
Tradeoffs between CLI and Visual Interfaces
Case Study: Two Ways to Write a Calculator Program
Transparency, Expressiveness, and Configurability
Unix Interface Design Patterns
The Filter Pattern
The Cantrip Pattern
The Source Pattern
The Sink Pattern
The Compiler Pattern
The ed pattern
The Roguelike Pattern
The ‘Separated Engine and Interface’ Pattern
The CLI Server Pattern
Language-Based Interface Patterns
Applying Unix Interface-Design Patterns
The Polyvalent-Program Pattern
The Web Browser as a Universal Front End
The interface of a program is the sum of all the ways that it communicates with human users and other programs. In Chapter�/a>, we discussed the use of environment variables, switches, run-control files and other parts of start-up-time interfaces. In this chapter, we'll untangle the history and explain the pragmatics of Unix interfaces after startup time. Because user-interface code normally consumes 40% or more of development time, knowing good design patterns is especially important here in order to avoid a lot of false starts and time-intensive rewrites.
Unix programs can give you extra power from being used in synergistic combinations; we discussed various methods for hooking together such combinations in Chapter�a>. The ‘other programs’ part of Unix interface design is not an afterthought or a marginal case as it is under many other operating systems. Rather, it is a central challenge that has to be balanced and integrated carefully with the demands of interface design for human users.
After startup, programs normally get input or commands from the following sources:
Data and commands presented on the program's standard input.
Inputs passed through IPC, such as X server events and network messages.
Programs can emit results in all the same ways (with output going to standard爋utput).
On Breaking These Rules Home 燗pplying the Rule of Least Surprise