I have done it three ways.
On the car, on one side of the car remove the caliper from the rotor, but leave the brake line hooked up, take the pads out and place a block of wood in the caliper so the piston can come almost all the way out. You don't want the piston to come all the way out...