Leaving battery in place when fully charged and connected to mains supply will indeed shorten it's useful life, the most common cause of premature battery failure.
Best practice is to remove the battery when it's fully charged if you don't need it (ie your laptop is usually connected to mains power for most of the time that you use it).
Refit the battery only when you are likely to need it, though you should re-attach every couple of months just to keep it topped up, then remove it again (a battery loses it's charge slowly over time, even when not in use).