Espaliered crops allowed for higher-value fruits without requiring any row-crop space. It was a natural development once fields were cleared and the stones placed in walls between fields; perennials (trees & bushes) took advantage of the uncultivated fencerows in that (A) they weren't plowed (B) they tended to capture condensation, making them moister than the fields. Espaliering became, effectively, "European bonsai" as soon as rich people figured out you could get fancy with the way the espalier grows: ...but since that costs time not money and since gardeners are a dime a dozen when you're filthy fucking rich, the rat race required the nobles to invest in greenhouses to one-up each other. Before too long you weren't anybody unless you could whip out an orange in November in Leeds.
Urban agriculture can help to solve such problems by turning urban wastes into a productive resource.