All the living organisms sharing a common environment . The members of a biotic community are usually divided into three major categories: producers, consumers, and decomposers , based on the organisms' nutritional habits. Producers (sometimes called autotrophs) include plants and some forms of bacteria that use solar or chemical energy to convert simple compounds into their food. Consumers (sometimes called heterotrophs) obtain the energy they need by eating living plants and animals, or dead plant and animal material (detritus ). Primary consumers (herbivores) eat plants, while secondary consumers (carnivores) eat other consumers. Consumers that feed on dead plant and animal material are called detrivores. There are two classes of detrivores: detritus feeders and decomposers. Detritus feeders (e.g., crabs, termites, earthworms, vultures) consume dead organisms or organic wastes, while decomposers (fungi and bacteria) feed on dead plant material, converting it into simple inorganic compounds such as carbon dioxide , water, and ammonia. Decomposers are also an important food sources for other consumers (e.g., worms and insects) living in the soil or water.