The absolute correct way is to install the air gap through a hole in on
the ledge of the kitchen sink. If it's not done this way, then IF your
drain were to ever stop up, and IF the stopped up water filled the sink,
THEN it could backflow and fill your dishwasher with dirty water.
However, most plumbers I know, simply loop the dishwasher drain as high
as they can under the sink cabinet, hoping the aforementioned senario never
happens (not that I'd ever violate the code, of course).