Thermodynamic theory of affinity : a book of principles