If you're worried about a possible market meltdown, or you just want to be sure your portfolio is fortified to some degree against downturns, conventional wisdom will have you invest in classic "defensive" companies. You know -- ones that make things people will tend to buy in any economy, such as medication, soap, or electricity.

There's a new defensive play in town, though: technology companies. They're not necessarily slam-dunks, but they deserve some consideration.

Fast growers
One reason to consider technology stocks is that they're growing considerably faster than the market as a whole. According to Thomson Reuters, tech has faster earnings and revenue growth this quarter than the overall market.

For example, Cree (Nasdaq: CREE), which makes semiconductor and electronics materials, such as LED components, has posted average annual revenue growth of 29% over the past three years, and earnings growth of 79%. Integrated circuit maker Cirrus Logic (Nasdaq: CRUS), meanwhile, has averaged 27% revenue growth, and its earnings are starting to take off. Over the past five years, software giant Oracle has averaged 21% and 20% annual growth for its revenue and earnings, respectively.

Cheap -- and valuable
Another reason to consider these companies is that, according to a variety of measures, many of them are simply cheap. When a stock is undervalued, by definition it carries a margin of safety -- and that can be useful in a market downturn, as it may help a stock not fall as sharply as others.

Consider fiber-optics giant Corning (NYSE: GLW). Its five-year average price-to-earnings (P/E) ratio is 12, but its recent P/E is just 8. Clearly, if it were to move closer to its historic average, its price would have to rise. Its forward-looking P/E is just 8, as well, compared with 14 for the S&P 500. Cisco Systems' (Nasdaq: CSCO) P/E is around 12, far below its five-year average of 20. Intel's (Nasdaq: INTC) P/E is about half of its five-year average, and Micron Technology's (Nasdaq: MU) forward P/E is just 6.

Beyond price alone, many of these companies stand to benefit from trends that can hurt other companies, like inflation. Rising prices of materials and commodities are putting pressure on manufacturers and retailers. This situation could lead them to invest more in software and other technological solutions to make their operations more efficient. 

Cautions
Despite all that attractiveness, there are some reasons to not consider many tech companies as defensive positions in your portfolio. Let's start with super-investor Warren Buffett. If he's not loading up heavily on tech companies, maybe we should think twice, too. He argues that he respects his personal circle of competence and avoids companies where he doesn't know what their future looks like. With many of these companies, their futures seem promising but far less certain than the likelihood that more and more people will buy soap in the coming years. SanDisk (Nasdaq: SNDK), for example, has been riding high on its flash-memory technology. But five years from now, the memory world might look vastly different, with SanDisk not near the top of the heap.

Some investors like technology companies as defensive plays because many of them are sitting on piles of cash and can pay dividends. (Intel, for example, recently sported a 3.4% yield, while Oracle has almost $12 billion in cash and more than that in short-term investments.) Well, remember that piles of cash can be used in suboptimal ways, too, such as on ill-advised acquisitions. Many observers think that Microsoft vastly overpaid for Skype, for example. Some of these companies can be quite cyclical, too, seeing business slacken sharply with economic downturns. If you're patient, though, that's not necessarily a problem.

Think twice
If you're looking to add some defensive stocks to your portfolio, to serve as ballast in a storm, go ahead and consider some tech stocks, because right now many of them appear to be compelling bargains. Hefty margins of safety offer a defensive edge.

If you do so, though, be aware of their risks and keep a close eye on them. Consider how just a few years ago many people had given Apple up for dead, and Microsoft looked like it could do no wrong. You may also want to invest in some technology companies purely because they're attractive, considering them regular holdings and not special defensive ones. For defensive investments, you can do well with the tried and true. Even after a major market meltdown, we'll still want to wash our hair, use electricity, and take our medications. Plenty of those companies are bargains these days, too.

If you like the idea of having more winners in your portfolio, take a look at these five stocks. The Motley Fool bought them all, and our analysts think they're good long-term prospects.