we used electric fences for our pointers and they worked well. and sure enough when our box went out and we didn't know it is when Hank jumped over the gate and got hit by a car in front of our house.
For a yorkie, I don't know. My in-laws live in the country and have an electric fence in the back 1 1/2 acres along with a regular fence. Gracie got back there once and got shocked. She doesn't go back there anymore so she learned the first time.