It's also not realistic that a farm can be built in 30 seconds. Point is, alot of things in this game are far from realistic. I think that opening and closing gates is a smart way to handle attacks.