Dream world (also called dream realm or illusory realm) is a commonly used plot device in fictional works, most notably in science fiction and fantasy fiction. The use of a dream world creates a situation whereby a character (or group of characters) is placed in a marvellous and unpredictable environment and must overcome several personal problems to leave it. The dream world also commonly serves to teach some moral or religious lessons to the character experiencing it – a lesson that the other characters will be unaware of, but one that will influence decisions made regarding them. When the character is reintroduced into the real world (usually when they wake up), the question arises as to what exactly constitutes reality due to the vivid recollection and experiences of the dream world.
According to J.R.R. Tolkien, dream worlds contrast with fantasy worlds, in which the world has existence independent of the characters in it. However, other authors have used the dreaming process as a way of accessing a world which, within the context of the fiction, holds as much consistency and continuity as physical reality. The use of "dream frames" to contain a fantasy world, and so explain away its marvels, has been criticized and has become much less prevalent.
A similar motif, Locus amoenus, is popular in medieval literature (esp. allegory and romance). A dream world is sometimes invoked in dream visions such as The Book of the Duchess and Piers Plowman.
One of the best-known dream worlds is Wonderland from Lewis Carroll's Alice's Adventures in Wonderland, as well as Looking-Glass Land from its sequel, Through the Looking-Glass. Unlike many dream worlds, Carroll's logic is like that of actual dreams, with transitions and causality flexible. James Branch Cabell's Smirt and its two sequels taken together form an extended dream and most of their action takes place in a dream world.