We never did any formal yard training but both of ours were yard trained. We just went outside with them when they were pups and when they wandered close to the edge we'd yell "your yard Pepper" or "your yard Autumn". It didn't take long for them to realize their terretory. The also only go to the bathroom in one spot. Autumn know the exact line between our yard and the neighbor's and she looks to me first before going in either yard. She is trained not to go in the road after a ball or a person, but if there is a dog walking down the other side of the street I have to give her a stern warning. I think its just a matter of the owner being in control and of the dog knowing their own territory.

Edit- If you try an invisible fence with buddy, make sure you are out there for a long time and pay attention to him. My neighbor's exhuberant lab could not be contained by an invisible fence. The second he saw another dog or squirrel he'd jump the fence, get shocked for a minute, then be on his way. After he left he didn't want to jump back into the yard so he'd stay loose. They had this fence turned up all the way and he'd flip over and yelp from the shock, but he'd still get loose on a daily basis.