Walls and moats to funnel the enemy. Currently two approaches to the fortress with a drawbridge on each, though one or the other is always open. This was necessary for a very small population to be able to manage the large construction projects far from the core of the fortress, by closing off one entrance. With a no-immigrant fort and a zillion kids running around, not doing this would have killed the fort very early on between population loss and tantrums. I also employed a deep weapon trap field early on when I basically had no military because ambushes showed up very early and often, but I took that down around the time I got my 2nd professional soldier.
No traps near the outer defenses, but one row of weapon traps near the inner defenses to serve as a last resort line (10 masterwork obsidian swords per trap, so it's a very effective line...). So far only gets snatchers. Ambushers never get close. No cage or stonefall traps. Mostly because dwarves can't resist wandering out in the middle of a battlefield to pick up a stone, and there's really no way to prevent dwarves from trying to reload traps and whatnot.
I don't have any champion markdwarves - as soon as they hit champion they switch over for wrestling, then hammer training. Even so, a pair of champion hammerdwarves and 4 or so training marksdwarves has had no trouble with 4 ambushes per season. I've had a remarkably small number of ranged gobbos come, however. It think no more than 6 out of at least 400. It's really quite odd. I'll be hitting 80 pop in about a year, so we'll see what sieges do for things. Around that time I'll have a ballista guarding each entrance. The entry roads are long enough that the ballista can't reach the end, so I can have it fire blind to thin out the siege numbers.
I don't expect I'll ever close a drawbridge to lock an enemy out entirely - mainly they are there to lock enemy in so I can finish them off. I did lock my fortress up altogether one time when I had an exceedingly slow trade wagon come that buttoned up all the others behind it (every walking trader with pack animal was laying down the entire time - it was very odd). It would move maybe 20 tiles per day and there were two ambush squads heading for them that would easily have overtaken them (spotted thanks to a mountain goat). I think the guards would have taken care of the ambushers, but I didn't want to have to clean all that crap up way out at the border if they failed, so I pulled the bridge up right behind the last trader, waited until the wagons got a bit closer to my inner defense line, and then opened it.
So far, the defenses has been pretty easy (too easy) since that 2nd soldier came online. My next fortress (already started but no map up yet) has upgraded gobbos and orcs, is also no-immigrant, and I've limited myself to only one of each type of automatic trap, with unlimited pressure plate/lever traps. And the fortress is hostile to humans on top of those two, so it's been pretty hard so far. Buttoning up the fortress is necessary when you get a siege of ranged units against only 10 dwarves with almost no military skills to speak of.
Map link in my sig.