Dogs and other animals often appear in A Portrait of the Artist as a Young Man as symbols of the lowly physical realm (in contrast to the quasi-spiritual realm of high art). In Chapter 1, Part 2, the narrator uses a simile to describe the eyes of a large black dog:
He saw the dark. Was it true about the black dog that walked there at night with eyes as big as carriage lamps? They said it was the ghost of a murderer.
The simile comparing eyes to "carriage lamps" creates a vivid mental picture of the ghostly dog by evoking the size and the color of its eyes. If the dog was indeed made up by the prefect to keep the boys in the dormitory, the carriage-lamp simile makes it more specific and therefore more believable. The comparison of the dog to an inanimate object also dehumanizes it and creates a sense of distance and fear. Stephen fears the dog because it is a ghost; perhaps this is why he admits to still being afraid of dogs in Chapter 5. The symbolic resonance of the dog reminds the reader that Stephen, who strives for intellectual development, nonetheless retains some of his irrational childish fears.
Joyce often uses colorful similes to describe Stephen's thought processes. In Chapter 3, Part 2, Stephen's mind becomes a flame-filled "tenement":
His [Stephen's] brain was simmering and bubbling within the cracking tenement of the skull. Flames burst forth from his skull like a corolla, shrieking like voices.
Stephen's thoughts take on a "simmering" and "bubbling" quality as flames burst (metaphorically) from his skull. The "crackling tenement" is a metaphor for Stephen's skull, which seems unable to hold his brain—thus implying that his thoughts are too intense for him to fully contain. This device also recalls Father Arnall's lectures about death, judgment, hell, and heaven. Stephen feels immense guilt about his lustful thoughts, so it makes sense that he would think of his own brain as a fiery, lustful entity.
In Chapter 3, Part 2, Stephen also finds solace in the thought of confession:
The thought slid like a cold shining rapier into his tender flesh: confession. But not there in the chapel of the college.
These two moments of simile and metaphor create a contrast between hot and cold thoughts—initially, his brain simmers and bubbles; eventually, though, a clear thought slides through his brain "like a cold shining rapier." Heat represents sin and uncertainty; sometimes Stephen's brain becomes a crucible of change. Cold signifies clarity and order, hence the "shining rapier" of thought that cuts through his bubbling brain.