“无头”是什么意思?

在阅读 应用程序编程指南的时候,我偶然发现了术语“无头环境”——这是什么意思? 下面是一段话:

... 包括具有 GUI 的应用程序和旨在在“无头”环境中运行的工具。例如,可以使用该框架编写操作 QuickTime 电影文件的命令行工具。

53704 次浏览

"Headless" in this context simply means without a graphical display. (i.e.: Console based.)

Many servers are "headless" and are administered over SSH for example.

You most likely know what a browser is. Now take away the GUI, and you have what’s called a headless browser. Headless browsers can do all of the same things that normal browsers do, but faster. They’re great for automating and testing web pages programmatically.

Headless means that the application is running without a graphical user interface (GUI) and sometimes without user interface at all.

There are similar terms for this, which are used in slightly different context and usage. Here are some examples.

Headless / Ghost / Phantom

This term is rather used for heavy weight clients. The idea is to run a client in a non-graphical mode, with a command line for example. The client will then run until its task is finished or will interact with the user through a prompt.

Eclipse for instance can be run in headless mode. This mode comes in handy when it comes to running jobs in background, or in a build factory.

For example, you can run Eclipse in graphic mode to install plugins. This is OK if you just do it for yourself. However, if you're packaging Eclipse to be used by the devs of a large company and want to keep up with all the updates, you probably want to find a more reproducible, automatic easier way.

That's when the headless mode comes in: you may run Eclipse in command line with parameters that indicate which plugins to install.

The nice thing about this method is that it can be integrated in a build factory!

Faceless

This term is rather used for larger scale application. It's been coined in by UX designers. A faceless app interacts with users in a manner that is traditionally dedicated to human users, like mails, SMS, phone... but NOT a GUI.

For example, some companies use SMS as an entry point to dialog with users: the user sends a SMS containing a request to a certain number. This triggers automated services to run and reply to the user.

It's a nice user experience, because one can do some errands from one's telephone. You don't necessarily need to have an internet connection, and the interaction with the app is asynchronous.

On the back-end side, the service can decide that it does not understand the user's request and get out of the automated mode. The user enters then in an interactive mode with a human operator without changing his communication tool.

Headless can be referred in terms of a browser or a program that doesn't require a GUI. Not really useful for a general person to view and only to pass the info in the form of code to another program.

So why one uses a Headless program?

Simply because it improves the speed and performance and is available for all user, including those that have access to the graphic card. Allows testing browserless setups and helps you multitask.

Guide to Headless Browser

What is GUI ?

In software development it is an architectural design that completely separates the backend from the front end. The front end, gui, or UI is a stand alone piece and communicates to the backend through an API. This allows for a multi server architecture, flexibility in software stack and performance optimization.