From 305879d3566b562ac290e3c44ad09664dd0419c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 21 Jul 2018 13:16:43 +0200 Subject: [PATCH] Add explanation about prefix decision See https://github.com/symfony/symfony-docs/pull/9886, I left out reasons related to overhead during compilation steps because that might be too technical. --- bundles/best_practices.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/best_practices.rst b/bundles/best_practices.rst index 00b1779e548..2df4d0ce0e5 100644 --- a/bundles/best_practices.rst +++ b/bundles/best_practices.rst @@ -451,7 +451,11 @@ Services -------- If the bundle defines services, they must be prefixed with the bundle alias. -For example, AcmeBlogBundle services must be prefixed with ``acme_blog``. +For example, AcmeBlogBundle services must be prefixed with ``acme_blog`` +instead of using fully qualified class names like in a project. This is +because a bundle should not pollute the list of autowireable types with +its own services, and to avoid service ids collisions with projects or +other bundles that might do so. In addition, services not meant to be used by the application directly, should be :ref:`defined as private `. For public services,