I'll throw this out here as well and expand on it slightly:
Ships go though refit cycles from time to time. Ships also get repurposed from time to time.
Take
USS Boston (CA-69). She was a heavy cruiser built during World War II and served during 1944 and 1945 in the Pacific. Following the war she was decommissioned as there were too many ships in the fleet.
In 1952 she was taken out of reserves and rebuilt as the worlds first guided missile cruiser. She kept the name USS Boston, but was renumbered to CAG-1. She served in this capacity until decommissioned again in 1970. However she was renumbered back to CA-69 in 1968. This was due to her missiles being outdated, so her purpose was to use her old 8 inch guns in combat instead of her obsolete missiles.
Back in the 1940s to 1960s, when a ship was rebuilt like USS Boston here, its class was also renamed. When built, USS Boston was a Baltimore-class heavy cruiser (of which there were 14 built). After her refit, she was given a new hull number, and was the first of the Boston-class guided missile cruisers (of which there were two, converted from the Baltimore-class cruiser Boston and Canberra).
Thus one ship can be part of two or more classes based on a refit. However, when one talks generally about the ships in history, they are usually referred to by the first class they were built as, rather than one of the classes they were refitted into.
So, if this is the case with USS Enterprise, she is called a Constitution-class starship by the 24th century. By general practice (from what I can tell), she would have been built as a Constitution-class starship in 2245. She may have later been converted to become an Enterprise-class starship and been properly called that to specify her from her older Constitution-class cousins, that had not been refit, or other Constitutions that were refit into yet another configuration and called by yet another class name.
What is interesting is that I can't find a real world example of a class that was majority refit and then had new ships built into that class. I could probably find ships that were built based on a refit design, but they would be a separate class of ship with more improvements over the old refit hull. There are examples of ships being changed while I the shipyard based on information from ships that were finished beforehand. They are sometimes classified as a different class, and sometimes they are considered the same class, just with differences (the Essex-class carriers had two different designs while under construction in World War II, a short hull and a long hull. The Long hulls were sometimes classed differently, as were some of the ships when half the class was given angled flight decks in the 1950s and the other half wasn't. Half were kept as attack carriers (CVA) while the others were made anti-submarine warfare carriers (CVS)) At some points they are called different things in places like Jane's Fighting Ships based on their hull configuration or their task. The name sometimes changes in Jane's to reflect the remaining existing ships if the "sub-class" ship leader is retired or sunk, they would sometimes reassign the "sub-class" leader title to the oldest remaining ship of the class.
So the definitions "Constitution-class". "Enterprise-class" and perhaps "Starship-class" could all be correct, at one point or another in the ship's history. But the evidence suggests that the ship class was originally the Constitution-class, based on how naming conventions work in history.