A general approach to the modelling of trophic chains