How long a bike will last would have to depend mostly on...
How often you ride it
How hard you ride it
If and how often you maintain the bearings and other components in relation to the amount of use and the conditions you use it in.
Also it's all well and fine with the idea of getting a Giant to strip for parts, but you have to think about weather the rear spacing will be the same (150 or 135?) on your new frame, will the seat post diameter requirement be different? What about the head tube, will it be 1.5, or tapered or 11/8? There is also BB width......so if you have to source new hub / rear wheel, new fork, new seat post and crank set, is it still a sensible idea? But of course you also have to consider that any unwanted or unsuitable parts would probably fetch a good price on the 2nd hand market anyway so it could still work. All I'm saying is do your research well first before going in that direction so at least you know what you're in for.
Depends also if you're looking at strictly new or considering 2nd hand frames as well?
The bike I'm riding at the moment was made in 2001 (first sold in '02), it's an Orange 222, I don't know if the swing arm was ever replaced or not but it's kind of a testament to how long a bike could keep going for. No doubt it's had many different owners and components on it during it's life time though!
I guess the trick is to get a bike that you really love to ride, then it will be worthwhile to keep it going for as long as you want to, even if you manage to break the frame!