From experience, I can tell you that a physical fence is a much better choice. It keeps other dogs out, is a visual aid to your dog that he/she can't go out of the yard, is easier to train for, etc.
But, in a situation where a fence is a) too expensive b) you live in a rental or c) neighborhood rules prohibit a fence, the invisible fence "can" be an okay choice. The biggest point I'll make is the importance of consistent and regular training. If you just put up some flags, walk the dog by them a couple of times, and then turn her out, it isn't going to work. You have to convince the dog it is a real barrier, and not just let her find out "the hard way" ie, a shock.
I had a foster dog go to a place with an electric fence. He was shocked by the fence after about a week there. He became so terrified that he refused to leave the house. He could be dragged to the front porch where he would hang over the side of the steps to "go" and then press himself, trembling, against the front door until let back inside. It was pitiful. I bought some very expensive drugs for anxiety and helped the new owner retrain him to be okay in the yard and it worked, but it took a whole heck of a lot more time than if they'd done the job correctly in the first place.
So please, do it right if you are going to do it. I would go with a real fence, livestock wire and posts--I fenced 4 acres in a weekend with a two man auger and a tractor to pull the wire tight as we went. Piece of cake.