I've found that personally if I try to write something just as I wake up, I may often lose the end of my dream while writing the beginning. Personally, I find it helpful to think through the whole process of the dream before beginning to write. This way, as I write I often remember little parts that I didn't at first.

I guess its all about what works for you though, I'd say give a few of these techniques a shot and see what happens.