We recently completed a series of obedience and training classes for $120, I think, it may not have been that much. That was WAY cheaper than a fence and best of all Ernie was
taught the proper way to act when outdoors on a leash or tie out. Give them the credit they are due, they are smart enough to learn how to behave with a harness on.
The desired behaviors we want from our dogs takes work on our part too. We cannot expect them to act a certain way without properly training them.