After the fall of the Toyotomi family in 1615, the number of castles was sharply reduced as part of the Tokugawa shogunate’s policy to enforce peace. Each domain was allowed to have only one castle. The feudal lords found it necessary to attract merchants and artisans to their castles since only they could provide weapons for war and luxuries for peace. The lords’ retainers, the samurai, lived next to the castles. This kept the samurai under their lord’s control. The numbers of samurai, merchants and artisans continually grew, producing towns. The layout of the towns was peculiar. Each class was separated from the others and the streets were arranged not for convenience, but for defense. Hence, even the main roads tended to be narrow and had sharp turns which would confuse and slow down an invader.
More extensive information can be found in the large entry on Castle Towns