It depends on where you dry hop. If you're doing it in a carboy, pellets or plugs are definitely preferred. Toss them right in (no bag), and after a few days they'll settle out (a good cold crash will also ensure that). Whole leaf hops can be a real pain to work with (and clean out of) a carboy.
If you're using a bucket, then either will work fine.
If you're using a keg, then I would suggest using a hop sack and tying it off with unflavored dental floss. Make the floss long enough to tie to the keg handle on top of the keg, so that when you put the sack in the keg it's hanging 1/4 - 1/2 way the height of the keg. The keg lid will seal right over the floss without issue. You can use whole leaf or pellet this way (provided your hop sack is a fine enough mesh to stop the pellet particles from getting into the beer).