I will be replacing my dishwasher and I am curious what is the current code for the wiring of the dishwasher.
Assuming you're in the US (though I can't imagine it being much different elsewhere, but do check!) ...
Be sure to check the label, but most dishwashers run perfectly happy on a 15A circuit. If a dedicated circuit to the dishwasher isn't possible, you can come out of a general receptacle circuit that isn't otherwise utilized in the kitchen, depending on the rating of the dishwasher. What you want to avoid is a mixer and toaster and dishwasher using the same circuit at once. You may have to do some investigating. Go for the dedicated circuit if that's possible.
If the dishwasher has a cord and cap, you should have an appliance receptacle installed where it can be reached. An appliance receptacle is an outlet with only one place to plug something in. Since your dishwasher can not be on a GFCI circuit, this ensures that someone won't try to plug something else into the non-GFCI protected outlet while near ground potential (within six feet of anything wet, e.g the sink). Even if the plug is somewhat hidden or inaccessible, you want to be sure nothing else uses it. Be sure the receptacle is rated properly, they come in 15 and 20 amp varieties.
If the dishwasher has a place to just terminate a cable, purchase the appropriate connector for the type of cable you're using (likely ROMEX (non-metallic + bonded)) to go into the 1/2" opening, secure the connector properly and make the connections using wire nuts.
Be kind to your future self, or anyone else that has to pull the dishwasher out in the future to service it by leaving enough cable to be able to pull it out and off to the side. Make sure the cable is secured properly wherever it is fed, and protected anywhere that it may be exposed on its path to the dishwasher.
If uncertain or uneasy - you probably want to call an electrician.
Current code suggests a dedicated line run to the breaker box for use with the dishwasher. 2008 NEC indicates that the kitchen should have two 20 amp counter top circuits to run small appliances.[So you can run a microwave and a toaster at the same time.] The NEC also says that those circuits should not be used for anything else.
-In a retrofit situation, you could tap into the counter top circuit if there is no other option. Unfortunately, with this arrangement, the motor and heating element will consume most of your available amps leaving you in a situation where you cannot use other things while the dishwasher is running.
On use of grounding and GFCI's... No matter what you do, ground the dishwasher to a reliable ground. If you are using new wire, this will be easy. Just hook up the green or bare wire to the frame of the dishwasher and bond the other end to the breaker box ground. If it is an older home with a two wire system, You can bond the washer to copper or iron water pipe (NOT A GAS LINE!!!) For safety, be sure that the pipes are bonded to the box ground or at least earth ground.
There is no prohibition on the use of GFCI in this circuit. The electronics in new GFCI devices greatly reduces nuisance tripping. You can use a GFCI breaker, an outlet, or even a GFCI dead front. (This looks like a GFCI outlet with no holes to plug anything in- and could be mounted at the counter top for accessibility)
My installation: (Dishwasher recommends 15 - 20 amp) I ran #12 MC Flex up and over through the attic to the washer and popped out of the wall to a box attached to the inside of the cabinet next to the washer. I installed a 20A GFCI paired with the 20A breaker in the panel. I attached a #10 stranded appliance cord to the washer with a 20A plug. I did this so I could have GFCI protection and also if the washer had a significant malfunction requiring immediate reaction, the cord could be pulled out without having to find the right breaker. I have used this setup for over two years and have not had any trouble from it.
MC Flex (metal clad) is a bit of overkill for residential (unless your local building code requires it), you can just use Romex if you wish. If you are using #14 wire, do not exceed 15A. If you use #12 wire, you can safely use 20A breaker (unless your dishwasher specifies 15A only.)