Joyce lived with Gogarty in "the tower" at Sandycove Point, southeast of Dublin, for a few days in September 1904. Telemachus realistically depicts the top of the tower and the living space one floor below. It also mentions the military history that produced these defensive fortifications. But Joyce chose this dramatic setting as much for its symbolic resonances as for its basis in lived experience: it gave him a way to begin his novel with parallels to Homer's Odyssey and to Shakespeare's Hamlet. Both of these works tell stories of usurpation and revenge, and both center on the powerful visual image of a royal palace.
Hamlet begins with sentinels meeting on the battlements of Elsinore castle just before daybreak, as Denmark prepares for war with Norway. A ghost appears, to inform Hamlet that there is an internal as well as an external enemy: his uncle Claudius has seized the Danish throne by murdering Hamlet's father. Like Shakespeare’s play, Ulysses begins at daybreak with Stephen and Mulligan meeting on the battlements of a military tower. Stephen is described at one point standing "at his post" there. There is no war, but in 1904 Ireland was still very much under British occupation, after the Home Rule movement of the 1880s died with the disgrace and death of the parliamentary leader Charles Stuart Parnell.
The so-called Martello tower in which the men are living embodies British occupation by virtue of its history and by virtue of the fact that an Englishman is currently living in it with Mulligan and Stephen. Haines later says to Stephen, “I mean to say, . . . this tower and these cliffs here remind me somehow of Elsinore. That beetles o’er his base into the sea, isn’t it?” (Stephen will think of this phrase from Hamlet again in Proteus.) This first episode of Ulysses will also introduce a ghost, in the form of a nightmare that Stephen has had about his mother. And it will liken Mulligan to Claudius in subtle ways, making him the usurper on the inside of the kingdom.
At the beginning of the Odyssey the palace on Ithaca has been overrun by insolent, armed young men, who have been eating and drinking Telemachus out of his patrimony, and who promise to continue doing so until his mother Penelope agrees to marry one of them. Mulligan is likened to the chief of these suitors, Antinous, at several points in the narrative, and his mixture of gaiety and malice recapitulates the spirit found in the feasting hall of Odysseus' palace. At the breakfast which he cooks for his two companions, "He lunged toward his messmates in turn a thick slice of bread, impaled on his knife"; later he mildly rebukes Stephen for eating too much of the food. At the end of the Odyssey, the feasting hall becomes an abattoir, as Odysseus and Telemachus separate the suitors from their weapons and slaughter them to the last man.