one thing to remember is according to the information I remember the constitution class was officially a heavy cruiser, the excelsior class was a battleship, and I am not exactly sure what the galaxy class was actually defined as.
Starfleet has always been to me a cross between a paramilitary force, and a full up military, and that "confusion" is reflected at various levels throughout the entire universe.
now nominally most of the main line vessels that were stars of their respective series were tasked with exploration missions, they usually had enough weapons to defend themselves just fine thank you if the "natives were restless/nasty" but they weren't intended as front line combatants until the defiant.
the difference is actually rather significant, were the federation ships armed heavily enough to qualify as warships? I would tend to say definitely, but they weren't typically "true warships" in the sense that everything about them was dedicated to getting the most offensive and defensive capability possible crammed into the smallest package that can do the job.... until the defiant in TNG/DS9 when the "warmongers" got a loud enough voice to be listened to after the borg incidents such as wolf 359.
thinking about the various shows and the ships "intent" enterprise first warp 5 ship for earth, explore the neighborhood and push back the frontier.
TOS constitution class, explore, the region, push back the frontier, do some "policeing" duties when you run into known hostile powers, (sort of cowboys/western in space)
TNG pretty much the same as TOS as duties, just given a bigger stick, due to the more hostile threats possible in the era, kind of added the whole Calvary coming to the rescue...
DS9 outpost on the edge of the frontier, hold the fort, and work to provide stability to the region while the government figures out what they can/ want to do in the area.
Voyager, craft intended for local patrols got thrown across the galaxy and....