That has been my concern too. Most of the local employers in this area are also defense contractors or depend on them - if one goes downhill, they all go downhill.
This is why, in my case, as I'm considering purchasing a house, I'm going for a lower-end one near the local university that I know I'll be able to sell more easily, or at worst case, slumlord to BU students. Fortunately, while the employment prospects for engineers are looking poor around here, the local university is expanding significantly over the next few years, which should keep the market for homes in the price range I'm considering healthy if I ever need to sell.
For me, I'm a big DIYer, and I want the freedom owning a home will give me. Also, in this area, homes are cheap enough that it is EXTREMELY difficult to find a home for rent - and I really want a basement and garage at this point.
Things are very different where I live though - A very nice home runs for $150-200k, and an OK one that needs a little work can be found for <$100k.