Invariants, Shimura Variety, and Hecke Algebra