Akiyo you gotta be creative
Design your base so you can put them in. One of my bases doesn't have walls and gates as defensive structure, everything is un-walled, so those walls and gates I have are only for aesthetic accents, cause I like a statement base.
Unless if you're talking about war base, then the first thing you have to think about is how you will protect your town center and crucial defensive buildings with those walls and gates