After tripling its share price since the end of 2008, Apple (Nasdaq: AAPL) has certainly rewarded long-term investors. But does the company have a wide enough moat to keep competitors at bay for the long haul?

The stuff moats are made of
Warren Buffett coined the term "economic moat" to describe the strength of a company's competitive advantages. Many factors confer short-term competitive advantages, but in his excellent The Little Book That Builds Wealth, Morningstar's Pat Dorsey convincingly argues that only four factors create an enduring economic moat. Let's use Dorsey's criteria to see what Apple's moat is made of, and just how sustainable it is.

1. Intellectual property rights
Moat-building intellectual property includes intangible assets like patents, licenses, and brands. Any company can have a brand, but truly moatwidening brands must increase a consumer's willingness to pay for a product.

Moat source: YES
Apple is not merely a technology company; it's a marketing machine. The company's products are sleek and sexy, and its commercials are catchy and clever. In an industry where hardware is practically obsolete by the time it hits store shelves, Apple's strong brand gives it a big edge. However, a high-profile flop could erode this advantage faster than you can say "Newton."

2. Customer switching costs
Products that are tightly integrated with a customer's business or lifestyle make it difficult for that customer to switch to a competitor's product.

Moat source: YES
Think twice before you abandon your iPhone or iPad -- ditching these devices also means kissing your app collection goodbye. Even beyond Apple's legendarily cultish following, those apps have made Apple's products sneakily sticky.

3. The network effect
The value of some services increases in direct proportion to the number of people using them. For example, Facebook offers a much richer experience with 500 million users than it did with a handful of undergraduate dorm-mates.

Moat source: YES
The iPhone's massive popularity has spurred developers to create more than 225,000 apps for that platform. Those apps attract new iPhone purchasers, who attract additional developers, feeding a virtuous cycle. Apple's first-mover advantage in apps has all but killed Nokia's (NYSE: NOK) chances in the smartphone market. However, the company must make sure that the surging popularity of Google's (Nasdaq: GOOG) free Android operating system doesn't steal away its developer community.

4. Cost advantages
Finally, lower costs can create lasting competitive advantages. The benefits of operational efficiencies and smart processes inevitably erode over time. A truly sustainable cost advantage, like economies of scale or a superior geographic location, simply can't be copied.

Moat Source: YES
As the 800-pound gorilla in consumer electronics, Apple can exert tremendous pressure on its suppliers and vendors.

Numbers don't lie
To determine whether a company enjoys a sustainable competitive advantage, examine its return on invested capital (ROIC) over time. Returns consistently exceeding a company's cost of capital suggest that it possesses a nice moat. Here's how Apple's ROIC stacks up next to competitors such as Dell (Nasdaq: DELL) and Hewlett-Packard (NYSE: HPQ):

















Source: Capital IQ, a division of Standard & Poor's.
Apple's fiscal year ends on the last Saturday of September of the named year. Comparable trailing-12-month periods are used in comparing to other companies.

Survey says: Narrow moat!
Apple has one of the strongest moats you'll ever see for a consumer goods company ... but at the end of the day, it's still a consumer-goods company. Although it's currently firing on all cylinders, its competitive advantages are not structural. They'll last only as long as the company can delight its fickle customer base.

Ready to buy?
Not so fast, my Foolish friends! Although we've demonstrated that Apple has an attractive moat, that doesn't automatically make it a smart buy. While competitive advantage is critical, it's also essential for investors to have a strong understanding of a company's management, finances, and valuation – and to always buy at a significant margin of safety.

That's the strategy our team at Motley Fool Inside Value employs. You can read all of the team's research reports, and see their best buys for new money now, with a 30-day free trial.

Rich Greifner does not own shares of any company mentioned in this article. Nokia is a Motley Fool Inside Value pick. Apple is a Motley Fool Stock Advisor selection. The Fool owns shares of Google, which is a Motley Fool Rule Breakers recommendation. Try any of our Foolish newsletters today, free for 30 days. The Motley Fool has a disclosure policy.