Why not design warships for continual sensor and weapon upgrades over a much longer life?
Short answerElectronics can be replaced, but hull fatigue from demanding service eventually makes structural renewal or replacement the limiting factor.
NotesWarships are already designed to receive new sensors and equipment during service. Repeated operation in the North and South Atlantic consumes hull life even when electronics can still be upgraded. The Type 23 life-extension work is described as extensive rebuilding and reframing, with old hull plating replaced by thicker steel. The structure carrying the equipment therefore limits the life of the ship.