I just lumped them both together since it's the same problem to me. Having 500 villagers in a little box or 500 cows in a little box is the same "exploit" in my opinion. Having a living entity cap is a brute-force way to make this less of a problem, but obviously having some real game mechanics like eating grass is a better approach. I'm not sure what a similar approach would be for villagers. Really, the whole door thing just seems silly to me. It was a lazy way for Mojang to solve villager breeding that we've reverse engineered to make grinders. I would love to see villager breeding that didn't rely on the arbitrary "door" mechanics.