Is the glass half empty or half full?

Is the glass half empty or half full? is an idiom. 
The question is a common expression with both an obvious meaning and a meaning which is inferred or implied.
The phrase describes two different ways of understanding the meaning of a situation.
The idiom is used rhetorically to indicate that a particular situation could be a cause for optimism (half full) or pessimism (half empty).
Metaphor.
The phrase is a metaphor. For example,