We put forward a coarse-grained model that describes the competition between the supramolecular polymerization of molecules and their binding to template molecules containing a fixed number of binding sites that are also present in the solution. Our model captures the salient features of the competition between this kind of self- and template-assisted assembly and demarcates conditions under which either is predominant. Template-assisted or "templated" assembly wins over self-assembly if the free energy gain of attaching of a monomer unit to a binding site is larger than that of binding it to a self-assembly. In order to find the optimal conditions for full coverage of the templates, we investigate the role of different control parameters such as stoichiometry and temperature on the binding efficiency. We also present a quantitative picture of the distribution of bound guest molecules along the templates for incompletely filled host molecules.