I think I may adopt a new Dwarf Fortress mantra: "No defense plan survives collision with reality."
The first time the goblins attacked my fort, I thought I was pretty well prepared. I could raise the drawbridge for our main entrance, forcing the goblins to attack through a large gauntlet of traps and siege engines. All of my dwarves were ordered to stay indoors, so as to not interfere with military actions.
Hah!
Dwarves, when ordered to stay inside, are apparently similar to little children: they like to get as close as they can to breaking the rules without actually going outside. So these stupid dwarves are crowding up in the exact worst spot imaginable - right between my military and the goblin invasion force, which is now about to come through the back door.
Fortunately, I someone managed to avoid a complete disaster. There were only 8 friendly casualties or so (minus the entire dwarven caravan which happened to be outside).
When the battle was over, I decided that I really need to revise this plan! I can't have all the civilians getting in the way like that again. So how to keep them from going so close to the back door?
Easy! I'll dig a skylight, so that part of the tunnel leading to the back door is considered "outside", and the civilians won't be allowed to use it! Sure enough, the next time the goblins attacked (with 64 invaders, no less!), my civilians stopped at the skylight, leaving the rest of the tunnel free for military action.
"What the...?!" I saw civilians begin to drop like flies, in a huge pool of blood and guts beneath the skylight.
Crap. Goblins can shoot down through skylights