To do it right takes buying good quality fixtures. WAC makes a pretty good line voltage halogen fixture in lengths fron 12" to 48". Also the higher end GE fluourescents are pretty good. With the WAC, I stub out some 14/2 MC cable. The fixtures come with appropriate fittings. You can jumper several fixtures together with short MC whips. The wiring space is small, but doable with #14 wire. By using MC, you get away from that gray area with exposed romex.
The GE Profile fluourescents come with a small junction box to run your feed into, then the lights plug into the j box with their own special cords.
A lot of the cheap crappy undercabinet lighting is tough to install in a code compliant manner. Customers just don't understand why you can't run zip cord thru the walls and cabinets.