Definition

===Allegory is one of several devices that fall under the category of extended metaphor. As a metaphor, allegory serves to convey meaning that extends beyond the literal interpretation of the text, events, or objects that comprise it. Allegory communicates its author's message by way of drawing connections between these components and their cultural symbolic meanings. As such an allegory must make sense on both the literal and metaphorical level. This is not to be confused with conceit, another form of extended metaphor, which is possessed of a more complicated symbolic structure. In the case of allegory the connection between the literal and the contrived subsidiary meaning are readily apparent.=== ===There are two dominant forms of allegory, the first of which is historical or political allegory. In this device, the components of the allegory refer directly to specific events or persons in history. If these events are not known to the viewer the meaning will likely be lost. The second sort is the sustained allegory of ideas. In this form, the components of an allegory directly represent concepts. A character, for example, may embody a particular virtue. The narrative that binds these representative components in a way that delivers an concept or thesis.===

For further description see these links:

Wikipedia

[|Plato's Allegory of the Cave]

Metaphor vs. Metonymy