I'm not sure where you get the idea that having a lot of ship classes is particularly unrealistic. This is particularly true when ship designs have extremely long designed hull lives and an ability to be refitted with modern technology regularly. If we go with modern hull designs where you have a relatively small number of capital ships, I suppose having a handful of modular ship classes that you can mass produce makes sense, but when you consider the sheer number of shipyards, potential designers and mission capabilities required by Starfleet, you're probably looking at a model more similar to the Royal Navy of the 19th century where you had ship "rates" that fell into general capabilities, but then design classes that were dependent on who the Surveyors of the Navy (designers) were, which civilian yards were getting contracts, who was in power at the Admiralty, etc.
For example between 1780 and 1830 there were at least 25 distinct classes of 74-gun third rate ships of the line designed in England, with many of these ships serving for the duration of the French Revolutionary and Napoleonic Wars. (1791 - 1815 so far as the RN was concerned) This isn't counting of course the various captures that the RN had gotten from the French, Spanish and other navies, which would add another 5-10 distinct classes just for battleships alone. Add everything from luggers to cutters, sloops and frigates, and you have well over 100 classes of vessel being used by the first truly global power.