Many pathogenic bacteria "speak" a chemical language by inserting proteins into host cells that affect the microbe's ability to invade or damage the host. For the insertion, they use a complex needle made up of a number of proteins (called a Type III secretion system). Similar proteins in similar structural arrangements are also involved in making the basal body of the flagella used for swimming. The two pieces of machinery, though differing in function, are evolutionarily related. Not only that, they interact with one another.
A recent study by a lab in Marseilles reveals that Pseudomonas aeruginosa can make only one of these pieces of machinery at a time, not both. No flagella, more Type III machinery, and conversely more Type III machinery, fewer flagella. The authors sagely propose that some virulence factors are coordinated but inversely regulated. Which are turned on and which are turned off likely depends on the differing demands of different stages and types of infection.
The structure of the bacterial basal body of flagella has been recently reported in its full splendor from David DeRosier's lab.