During the Sengoku Period the importance of castles grew as military and government functions became centralized around them. With the increasing administrative role of castles they also became the economic centers of provinces. Vassals moved their personal quarters near the castles, peasants, artisans and businessmen soon followed and the successive expansion of these castle towns led to what are some of the largest cities in Japan today. Much of the layout and planning of Tokyo was designed by the Tokugawa to be built around the castle.
The castle town was viewed as an extension of the castle's defenses. The roads surrounding it are a maze of dead ends, T-junctions, and narrow winding streets. Some castle towns, in addition to the aforementioned maze of confusing streets, had one large avenue that led directly to the main gate of the castle. Any attacking force who dared to tempt this lane would find itself in the most heavily fortified part of the city. The Otemon (main gate) is the strongest of all the gates and the lane was lined with homes of loyal retainers. For a beautiful example of this type of castle town you should visit Kakunodate in Akita Prefecture. Kakunodate also has some of the most beautifully preserved samurai houses in Japan. The picture above is of one of the streets in the samurai quarter of Kakunodate.
See the page on Samurai Homes for more information and pictures about the samurai residences