Analogy and metaphor (and simile)

Definition, discussion and examples on the internet are confusing. The confusion can be pushed aside if we focus on the key quality shared by all three terms, namely, inviting readers (or listeners) to think about A as if it were B.

I would use the term analogy for cases in which the characteristics of B and the way that A and B correspond are meant to be obvious and thus the readers know what B means they are supposed to think about A and which aspects of A. If asked, the writer could make everything explicit.

I would use the term metaphor for cases in which the associations that B has, which the metaphor carries over to thinking about A, can vary among readers and go beyond what the writer had in mind. The characteristics of B and which aspects of A and B correspond are not so obvious.

Whether an expression serves more as an analogy or a metaphor may depend on the situation, that is, the writer and audience.

(The three examples come from http://fos.iloveindia.com/analogy-examples.html, a site purporting to give examples of analogies. See more discussion of metaphor and its use in science and in interpretation of science.)