On the dynamics of dislocation patterning