I do all my work on a MacBook Pro and it is always connected to the power.
Is it ok to do this (from the battery view point)?
Should I empty it entirely periodically? if yes what is the preferred period?
A laptop that just sits on AC power all day and never on the battery will reduce how long it lasts. Give it some exercise by unplugging every now and then – Apple recommends giving it at least one charge cycle a month. So, unplug for a bit at least once a week and it should add up to one charge cycle a month. Remember, partial discharges are better than full.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
I unplug frequently, and I've noticed that Battery Health Monitor seems to be mirroring what I am experiencing. When I first got my laptop, I would get around 3 hours unplugged. Now I get just a little over 2 hours, and Battery Health Monitor reports that my battery is around 75% of it's capacity fully charged. It will be interesting to keep track of this to see if, around a year from now, the battery gives out.
I think it's not a good idea to keep laptop plugged into power. A battery has a life (say 1000 charges) & if you charge it frequently it'll finish soon – although it’s not worth thinking about it. The idle way is to charge it when you need it (instead of continuously charging it) & remove it from charging if you don’t need it, IMO.