I've got a set of the Happs opticals for my cabinet, and the rotary is an analog interface. You'll need to give each rotary 5v, a ground, and the two analog signal wires.
I've got a KE72 encoder with a mouse input, so each rotary is getting wired to a mouse axis. The benefit of this is I can use the joysticks for mouse control in Windows kinda like an Etch-a-sketch. The other reason I went with the opticals is that I didn't want to feel clicks when turning the joystick, mostly for when I'm NOT playing a rotary game, like a fighting game.
If you get the mechanical rotary, you'll need to make/buy something like Druin's interface board so the joysticks will spit out the right signal for MAME. If you search the boards you'll find lots of threads on the subject, one of which I think I started a while back.