预计阅读本页时间:-
Applying Unix Interface-Design Patterns
Applying Unix Interface-Design Patterns
广告:个人专属 VPN,独立 IP,无限流量,多机房切换,还可以屏蔽广告和恶意软件,每月最低仅 5 美元
To facilitate scripting and pipelining (see Chapter�a>) it is wise to choose the simplest interface pattern possible — that is, the pattern with the fewest channels to the environment and the least interactivity.
In fact, by combining a theme from Chapter�a> with this idea, we can perhaps name a new design pattern emerging under Linux and other modern, open-source Unixes where GUIs are not merely a reluctant add-on but an active focus of lots of development effort.
The Polyvalent-Program Pattern
A polyvalent program has the following traits:
The program's application-domain logic lives in a library with a documented API, which can be linked to other programs. The program's interface logic to the rest of the world is a thin layer over the library. Or perhaps there are several layers with different UI styles, any of which the library can be linked to.
One UI mode is a cantrip, compiler-like or CLI pattern that executes its interactive commands in batch mode.
One UI mode is a GUI, either linked directly to the core library or acting as as a separate process driving the CLI interface.
One UI mode is a scripting interface using a modern general-purpose scripting language like Perl, Python, or Tcl.
Optional extra: One UI mode is a roguelike interface using curses(3).
Figure�4.燙aller/callee relationships in a polyvalent program.
Notably, the GIMP actually fulfills this pattern.
Unix Interface Design Patterns Home 燭he Web Browser as a Universal Front End