Living in such an urban environment as we do here in Vancouver, I often hear of owners who have dogs who bark when left being advised not to go back into the room until the dog has stopped barking. This is good advice, as we don’t want the dog to think that barking makes the door open. However, it’s slightly more complicated than that.
Dogs who bark for attention will usually bark in a repeated pattern. For instance 2 barks, short pause, 3 barks, short pause, 2 barks, short pause, 3 barks, short pause, 2 barks, short pause, 3 barks, long pause. The long pause is to see if there has been any reaction to their barking. If you open the door during any of the pauses (because you’ve waited for the dog to stop barking) in the dog’s mind the door has opened because of their barking and you will have reinforced that idea. Your dog will now bark more when they want a door to open. Attention seeking barking isn’t very demanding of energy, so dogs can keep it up for a very long time.
To ‘fix’ the problem with a dog who has made a habit of attention seeking barking over a long period of time, you need to make sure the door does not open for at least 2 minutes after the barking has stopped (be strong!) to be sure the dog has given up on the barking. With a younger dog if they become distracted by something else that’s a good time to open the door, or better yet, if any age dog lies down, and perfection, they sigh. That’s the perfect time to open the door.