Self-assembly in soft-matter systems often results in the formation of locally cylindrical or chain-like structures. We review the theory of these systems whose large-scale structure and properties depend on whether the chains are finite, with end-caps or join to form junctions that result in networks. Physical examples discussed here include physical gels, wormlike micelles, dipolar fluids and microemulsions. In all these cases, the competition between endcaps and junctions results in an entropic phase separation into junction-rich and junction-poor phases, as recently observed by electron microscopy and seen in computer simulations. A simple model that accounts for these phenomena is reviewed. Extensions of these ideas can be applied to treat network formation and phase separation in a system of telechelic (hydrophobically tipped, hydrophilic) polymers and oil-in-water microemulsions, as observed in recent experiments.