What do you mean by "module"? If you are referring to the modular fire control unit, yes, any 9mm/.40/.357sig FCU will work with any 9mm/.40/.357sig upper. If you are referring to the plastic grip module, no, a subcompact upper will not fit with a compact grip module. It would likely function ok, but the dustcover of the grip module would overhang the front of the subcompact slide.
Your wording further confuses me a bit when you refer to using a "subcompact barrel/spring"...just to make sure we're clear, you would need a complete upper (barrel, recoil spring assembly, and slide assembly), not just a barrel and spring. A subcompact barrel is too short to function properly in a compact slide, and could create a very unsafe condition.
ETA: I took a few photos to illustrate:
Compact Slide (Top) and a Subcompact Slide (Bottom)
Subcompact Barrel in a Compact Slide.
DON'T DO THIS!!!! You can clearly see that the barrel does not reach the end of the slide. The barrel doesn't lock up properly, and while the gun might fire, it would likely end very badly. I repeat, this is unsafe,
DO NOT DO THIS!!!!!!!
Subcompact Slide on a Compact (well, actually a "Carry", but the relevant dimensions are the same) Grip Module. You can see the dustcover overhangs by about half an inch.