Foil
Character Role Analysis
Sergeant Troy/ Farmer Boldwood
If Gabriel Oak turns out to be the man who's juuuuuusst right for Bathsheba, Sergeant Troy and Farmer Boldwood are the men who are respectively too hot and too cold.
Sergeant Troy is dashing and handsome, but he's also too superficial and selfish to ever give Bathsheba happiness in the long run. Farmer Boldwood, on the other hand, is respectful and dignified, but he also doesn't even care if Bathsheba loves him; he just wants to possess her as a wife.
It's only by encountering these two men that Bathsheba eventually learns that Gabriel Oak is the right man for her. By this point, mind you, Sergeant Troy is dead and Boldwood is in jail for life.