From f45cf7f6dafaf520001e1f42c9167b5d7eaec442 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 04e00f0ccfb..48cf2ed2ab0 100644 --- a/bundles/best_practices.rst +++ b/bundles/best_practices.rst @@ -382,7 +382,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 do 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,