Mechanical modeling: placing a bar between two ball joints
Something like this:


Place the origin of the cylinder at one end.
Parent the cylinder to the first sphere.  Reset the cylinders origin (Alt+O) to position the end of the cylinder at the first sphere.
Add a Track To constraint (Ctrl+T) to the cylinder with the target as the second sphere.  Adjust the track axes until the cylinder is aligned towards the second sphere. 
Apply the visual transformation (Ctrl+A) and delete the Track To constraint.
Scale the cylinder along the local Z axis (S,Z,Z) until it intersects with the second sphere.