My take: Once again we find David on the run hiding in the wilderness. Though he is the annoited future king, Saul is after his head. A great quality David possesses is inate ability to bounce back. He can and often goes on an extended lament and snap, he is back on track; positive, motivated and more endearing than ever.
Isn’t it wonderful we don’t have to earn our righteousness? All we need to do is take our refuge in Christ. Like a turtle in its shell, we are safe. What a great forshadowing told by David. Yes, lets exult our hearts up to God. When we do so, our spirit is certainly elevated in the process.