I agree with the above.  While it might work and work well for a large dog - it will not protect your 7 lb yorkie from anyone that might wish him harm - be that someone that would steal your little dog OR a big dog that might not be so friendly.   
I'm a huge proponent of regular fences.   
I've had to shell out 3 times to build one each time I moved.  But they are worth it. A fence would protect your kids as well - from running into the street, etc.     
				__________________   Mommy to Lucy, Ringo, and Matthew       |