Homological Theory of Representations