Of course it's a good idea to disconnect the battery if the car is not in use for 'many' months, if you want to really do the job properly you should also jack the car up on all four corners to stop the tyres going out of shape on the bottoms, very impractical as it happens in most cases, plenty of sensible things to do when storing a car.
Be aware if you did disconnect the battery that more and more of the newer cars can do strange things when reconnecting batteries, yes many will say 'Well I do, and nothing ever happened' try it on some Mercedes and see the results, watch the radio blow on some newer Fords, Watch some strange things happen on some Hondas, see if your central locking works after, your one press electric windows haven't forgotten the code to work correctly.
Lock the car with the bonnet up while you disconnect the battery and hope you don't send the wrong message's to the ECU and alarm system because the alarm is sending messages to the ECU, and then gets interrupted, make sure you know the radio code if the radio has one, and is factory fitted, some no codes, some have.
My own personal car is garaged at my house in Spain, I use the small solar panel trickle charger all the time, I closed the up and over door, closed the rear door, watched where some light came in around the up and over door, and hung the panel about a foot away from this small light source, it worked and my car starts every time it's needed.
I expect a lot of people know how to help a friend out by jump starting their car when its battery goes down, the next door neighbour of one of my customers knew how, damaged four main electrical items, and cost her just under £800 to get put right...I just wish more people would do this, great for business.