Origin of the abundance patterns in Galactic globular clusters: constraints on dynamical and chemical properties of globular clusters