All these posts claiming that the Romans could simply have consolidated their forces into more easily defensible lines are missing the point. By the 4th century the Roman state, particularly in the West where it had less 'Roman' manpower to draw on had come to heavily rely on Germanic barbarians to fill the ranks of army. The practice of settling Germanic federates inside Roman territory both as buffers against other barbarians and as sources of manpower, shows how critical Germans were to the Roman system of defense. There were a lot of reasons for this. The quality and numbers of potential native Roman recruits had declined significantly due to demographic decline from the 3rd century and the rise of manorialism. Unfortunately, at the same time the defense needs of the Roman state had multiplied with increasing external pressures, leading to an expansion of the army and a dire need for more sources of manpower. The Germanic barbarians, numerous and excellent soldiers, were a perfect supplement and were brought in in ever-increasing numbers.
This trend was strongest in the West which had a weaker demographic base, a longer and less easily defensible frontier, and a more ready supply of barbarians to draw on. Of course the whole policy eventually backfired, as these barbarians came to dominate not just the army but also the territory and power structures of the West. However, the alternative was just as bad. Without the German manpower, the Western Roman state would have had an ineffective army and been unable to defend itself even to the extent it did OTL against incursions by other barbarians. Basically, thanks to its large size, limited resources and growing insecurity the West was stuck in a very difficult position with no real solution that I can see. Simply having a more balls-to-the-wall defensive strategy isn't going to cut it, since the army is basically half-barbarian anyway and a huge part of the problem. The crisis the Western Roman Empire finds itself in is systemic, not something that can just be averted by some unlikely military decisions