A Methodology for the Study of Online Algorithms