Commodore, in World War II, was a flag rank in the United States Navy. It came back in 1982 as a flag rank, but has since been replaced with Rear Admiral (Lower half) or "One Star" Rear Admiral.
It was replaced specifically because it had too many meaning different naval and nautical circles. In the 1960s and today, it was a title for a senior captians that control major air wings, naval squadrons, or other major command groups. However, Star Trek writers, from what I can gather, were still using World War II usage as a rank, otherwise all the commodores would have captain's stripes.