How best to maintain a mobile phone's battery?

What is the best way to use a mobile phone when wanting to ensure longest possible battery life (not between charges, but overall lifetime capacity)

Should I drain the battery as much as possible then charge back to full as required or is it better to plug it in and keep it topped up when possible?

I can keep my phone plugged in and charged most of the day at work, is this better then only charging it overnight?

thank you Verge.