You may have read in our "Character Analysis" of Sherlock Holmes that we asked if Holmes might have been a real guy (the answer is no, by the way). We pointed out that Conan Doyle is always making these odd little self-conscious remarks about fiction: Holmes often tells Watson that reality produces way weirder stuff than the imagination of any author could cook up. But, of course, all of this is the product of Conan Doyle's imagination, so we guess that's a – joke? Anyway, whether we're laughing or not, we have to admit that The Adventures of Sherlock Holmes, while totally fictional, does go to a lot of trouble to look like reality. And one way it does this is through the setting.
The apartment where Holmes and (sometimes) Watson live (the chronology jumps around) is absolutely filled with stuff: gold snuff cases, scrapbooks of newspaper clippings, an encyclopedia, a shoe filled with tobacco, Holmes's chemical apparatus, a sofa, a pipe-rack… Seriously, you have to wonder how anyone gets into the room at all, it's so packed. But having all of these things brought up to set the scene gives 221B Baker Street a sense of real, physical presence that makes it compelling to read about (and Sidney Paget's illustrations don't hurt).
These endless details don't stop at the apartment: consider the regular cataloguing of the city of London as a whole: from Hyde Park and the Serpentine in "The Noble Bachelor" to opium dens and the Thames in "The Man With the Twisted Lip." There's the fictional Saxe-Coburg Square of "The Red-Headed League" mingled with the completely real St. George's Church in Hanover Square in, again, "The Noble Bachelor." And connecting all of these spaces are vivid descriptions of systems of transportation: the London Underground, hackney cabs, boats, and trains appear over and over again.
And then there's the larger world that revolves around London: Mary Sutherland inherits money from her uncle Ned in Auckland, New Zealand, in "A Case of Identity." Dr. Roylott spends time in India ("The Speckled Band"), John Turner and Charles McCarthy once lived in Australia ("The Boscombe Valley Mystery"), and Elias Openshaw spent time in the U.S. ("The Five Orange Pips"). Miss Rucastle and Mr. Fowler go so far as to immigrate to the island of Mauritius. What we're getting at here is that this is a well-traveled bunch of people.
The image of London that emerges in Sherlock Holmes's stories is of bustling economic prosperity at the center of a giant colonial empire. As for Holmes's sooty, crowded London, we get a glimpse of it in illustrations of "The Resident Patient" and in "The Adventure of Charles Augustus Milverton" (very atmospheric). The empire giveth and it taketh away, though: colonialism brings men like John Turner vast amounts of cash, but it also introduces political (see "The Five Orange Pips") and personal (see "The Speckled Band") instability. The British Empire brings floods of new things to London – jewels such as the Blue Carbuncle or the 39 beryls of the Beryl Coronet – but also then provides yet more opportunity for thieves like John Clay ("The Red-Headed League") and Sir Richard Burnwell ("The Beryl Coronet").
As modes of transportation improve connections between different places, you also come to understand the huge criminal and moral threat of being able to disappear at will ("A Case of Identity," "The Noble Bachelor," and even perhaps "A Scandal in Bohemia"). Just as London is being enriched by its exploitation of other nations, it's also getting drained by poverty and begging (think of the opium dens of "The Man With the Twisted Lip").
In other words, late-nineteenth-century London is a cosmopolitan space – a huge city bringing together new populations, new commercial goods, and new forms of transportation into one giant hodgepodge of activity. Without trains to bring him to his cases, without objects like the Blue Carbuncle, and without groups of strangers to visit in disguise, where would Holmes be? He needs a city like London to be a detective at all. Holmes's setting and his job are part and parcel of the same thing: a sign both of London's growing wealth and its growing insecurity.