Personally, and this is just a personal Opinion, I believe that Bullet Weights for a particular Cartridge, or a particular Caliber, were brought about for different reasons. I believe it has more to do with Ballistics, External and Terminal.
I think that there are some Internal Ballistics at play, such as the "Strength" of Recoil Springs, and what-not, but I feel that it was more about In-Flight and On-Target Performance.
I prefer lighter bullets, to begin with. I had a Glock 21 for quite a few years (I sold that pistol 4-6 weeks ago), and I focused on 185 grain bullets, for alot of reasons. A 230 grain bullet is alot, and unless I'm carrying it for Wild Pig, that bullet will over penetrate just about anything. The 185 grainers will penetrate PLENTY, whatever the target, but they tend to be alot faster, with less recoil, more ControlAbility...unless they're loaded hot, then recoil comes back as powder charge increases.
The Glock 21 is a Full Size... Now, for the Compacts and Sub-Compacts, I'd stick to Strictly lighter bullets, for recoil reasons.
But, to answer Your question, to the extent of my knowledge, I don't think that the lighter or heavier bullets were designed with Longer or Shorter barrels in mind. I believe that the Faster/Slower Burn Rate Pistol Powders were invented Back In The Day, more so with Barrel Length (and smaller cartridges) in mind.