The D-7 itself was probably phased out by the TOS movies, given from TMP onward we see K't'ingas.
Actually, the
K't'inga probably is a D-7. Perhaps a D-7c or something like that, as opposed to the ENT ship being D-7 and the TOS ship being D-7b or something like that, but all these slightly different designs seem to come under the same D-7 designation.
Source: VOY episode "Prophecy", where a Klingon vessel identical in shape and detailing to the vessel seen from ST:TMP onwards is explicitly called a "D-7 class cruiser", and is said to have been retired "decades ago".
No doubt the D-7 design was upgraded several times during the two centuries of service, and probably no original 2150s hull survived till the 24th century. But the design apparently was good enough to see continuing frontline service until the mid-2300s, as per Tom Paris' "Prophecy" statement. And even after retirement, some of the ships were probably "current" enough to be recalled to service in the Klingon invasion of Cardassia and later in the Dominion War, where we saw several in action. Similarly, Starfleet probably reactivated old
Mirandas after officially retiring the type from frontline combat use...
Tom Paris would of course not be aware of these reactivations, as he'd have left the Alpha Quadrant a year or so before the Klingon invasion of Cardassia. So no continuity hiccups there.
If you keep building new ones with updated technology, why shouldn't they last for 200 years? If the basic design is sound, why not?
In today's world, the reason for "why not?" would be "because the enemy keeps on improving". We can't build B-17 Flying Fortresses today, even though they are excellent carpet bombers, because they are also extremely vulnerable to today's anti-aircraft weapons.
However, in the world of Star Trek, this argument need not hold. Even if Starfleet in the 2370s builds ships that far outclass the D-7, it is possible that most of the enemies of the Klingon Empire build ships that are greatly inferior to the D-7. It would be foolish to dedicate unnecessarily great resources and build
Vor'cha class vessels for use against all these primitive enemies, when one can use older, tried and true technology in some theaters and cutting edge tech in others.
One might argue that standardizing on a single type of technology would yield advantages - and then of course one would have to standardize on the latest tech. But this need not be true, either. Starfleet operates a really diverse fleet of several types, suggesting that there isn't any advantage to standardization after all. Perhaps future manufacturing techniques are not dependent on maintaining an expensive tooling set for each product type, and the production of D-7 can continue even if the original factories have long since been converted to daycare centers or landfills.
Timo Saloniemi