This photo from 1943 shows the mass production of U-boot on a german shipyard. For minimizing the damage caused by aerial attacks, the parts of these submarines were produced in separated and distant places, to be later transported to the shipyards where the submarines could be then quickly assembled and equipped.
The Ohio-class guided-missile submarine USS Georgia (SSGN Bay, Greece. USS Georgia is on her maiden voyage SSGN deployment since converting from a ballistic missile submarine to a guided-missile submarine. (US Navy photo)