I would say an ideal team for me would be:
2 Light Operatives: for scouting out ahead and flanking the enemy also can capture Control Points
1 Heavy Medic: in order to bring the fight to the enemy and get hit while healing teammates in the front line
1 Medium Medic: to heal the main heavy medic and get to players who are further quicker, and still take some hits
1 Medium Engineer: to buff players and set up mines and a turret
1 Heavy Soldier: to obviously take most of the hits and mow down the enemy
2 Medium Soldiers: for taking down enemies in the front line and pushing them back and setting up the C4 or bombs in order to complete the mission
This is a pretty basic team I think yet it has its flaws. I'm curious to see what you guys come up with.
Edit: I know an ideal team or a perfect team doesn't exist. This is just to for you to use what you know about the game to create a formula you think will be effective.