The Confucian class system in the Edo period had four classes: samurai, peasants, artisans, and merchants, in descending order. While the samurai were esteemed because of their learning and their ability to govern society, peasants were valued because Japan was primarily a farming economy and peasant farmers were the one class that produced things of value with little more than their labor. In reality, peasants were not as well treated as the Confucian class system suggested they should be. They were usually despised and often ill-treated.