how to define an integral from a spectral family?

for Riemann integral, we fix an epsilon, we use upper sums, lower sums, a partition, etc.... then we proof that this integral is independent for the choice of this partition and this epsilon , but here what is the main idea? how is it constructed? is there notion of "it's well defined" ?please help me.