Personally I think it's best to specialize. I've reached level 20 on my main character and by that point you have enough skill points (Or whatever they're called. Never really looked, haha!) to basically buy every skill for two classes and that in my opinion is all you need.
I have everything in the Engineer skill set bought with the exception of the kevlar because I find that it's not very effective and it's better to spend supplies on buffing my teammate's gun damage. And I have everything in the Medic skill set bought except for the supply transfer because I think that as the medic, my supplies are more valuable to the team than those of any other class and I have no need to go giving them away. Also in the universal skill set I have the one that increases your health, supply increase, supply regeneration, and downed fire.
With just those I can switch between Medic or Engineer and be able to help my team out in a vast majority of situations. And if for some reason I need to switch to another class (For example, I need to become a soldier because nobody else is planting the charge and time is running out) then I plant the bomb, defend it until it goes off, and then run to the nearest command post (Or rush into the enemy with guns blazing so they'll kill me) so I can switch back to the class that I know how to play well so I can continue helping my team.