Producers
Ecologists -- scientists who study the interrelationships among living things and their environments -- classify organisms that are capable of manufacturing their own food as producers. With few exceptions producers are green plants or algae. In an ordinary lawn, garden or small field, plants tend to be the most conspicuous lifeforms. They use the energy from sunlight to manufacture their own food and sustain themselves through photosynthesis.
Herbivores
Many herbivorous, or plant-eating, insects exist in a mini ecosystem. One good example is the aphid. The aphid is a small insect that has a piercing and sucking mouthpart that it inserts into a plant stem or leaf to suck the plant's juices, which are its food source. Another insect herbivore is the larva of the sphinx moth. Many gardeners are familiar with this caterpillar as the tomato hornworm. The tomato hornworm caterpillar feeds on tomatoes and related plants.
Predators
Some insects are not interested in feeding on plants but, instead, focus their attention on other insects. A prime example is the praying mantis, a large predatory insect. One insect the praying mantis feeds upon is the aphid. So, just as in a large-scale ecosystem, a mini ecosystem features producers, consumers or herbivores and predators.
Parasites
Some organisms in the mini ecosystem play a role that is neither producer nor herbivore nor predator. These are the parasites. An example of an insect parasite in a garden's mini ecosystem is a parasitic wasp that attacks tomato hornworm caterpillars. The wasp lays its eggs on the caterpillar and, when the eggs hatch, the larvae feed on the caterpillar. As the larvae mature, they form small, white cocoons that remain attached to the dead or dying tomato hornworm caterpillars. This is an example of some of the drama that plays out among the plants and insects in a mini ecosystem.