What should come 1st, affection, discipline, or exercise for your dog? What your dog actually needs is exercise, discipline, and then affection. Many people tend to only give their dog affection and by doing this it only upsets the dog's natural rhythm or balance. When that affection is given at the wrong time it will then reinforce that behavior. So keep in mind that when your dog is fearful, anxious, possessive, dominant, aggressive, whining, begging, barking, or doing something that's not acceptable, that this is not the appropriate time to give your dog affection. Any time you give affection it only reinforces the behavior from before. The only thing that will stop your dog's bad behavior is setting and reinforcing rules, boundaries, and limitations. Only use affection when your dog is behaving at its best.
Also note, that when you give your dog too much affection right away in the morning or when you come home from being away for a long period of time, that this will only encourage over excitement. Affection is best after exercise and feeding because your dog is more in a relaxed and submissive state of awareness.
For the love of dog - Carey