I've had more problems with functional obsolescence than hardware failure.
17" G5 iMac, purchased 12/04, died in 2011 when power supply capacitors failed (a known issue with computers in that era). Gave to friend who replaced the caps. It's still running in light duty use.
20" C2D iMac, purchased 11/06, gave away 2/10. Had display failure when I had it (fixed under Applecare). Had hard disk failure since.
1 4 year old iMac and 2 3 year old iMacs (27" and 24") all still running, no repairs.
17" G5 iMac, purchased 12/04, died in 2011 when power supply capacitors failed (a known issue with computers in that era). Gave to friend who replaced the caps. It's still running in light duty use.
20" C2D iMac, purchased 11/06, gave away 2/10. Had display failure when I had it (fixed under Applecare). Had hard disk failure since.
1 4 year old iMac and 2 3 year old iMacs (27" and 24") all still running, no repairs.