It really is the hardest part about managing in the cap era. You simply have to choose the right risks to take with young players, and lock them up for as much of their mid and late 20's as you can for the right price, and avoid almost all risk with long term contracts for non elite players in their late 20's/early 30's. So as good as the Kadri's, and Gardiner's of the world are, if you're put into a position where you absolutely need to sign them into their mid 30's, you've ****ed up and you're really likely to regret it.
If you can't get your good young kids signed to long term team friendly deals (Rielly, and Kadri for example), you have to play the game with them of exploiting their RFA years and then look to move them when they're getting close to UFA. Depth guys in the Brown and Hyman vein are fine for a few years when they're cheap, but as soon as they get expensive (for them, I'd suggest anything more than they currently make is expensive) they have to go to. The single most important organizational skillset in the cap era is draft and develop. If you aren't churning out players of every stripe, on a regular basis, you're going to be forced into choosing between letting your team get worse, or making a bad cap decision and most managers are going to make a long term bad decision out of short term self interest when push comes to shove.