Even if I've spent a lot of time updating code and doc for the removal
of the Bundle suffix, I'm +1 for adding it back. It felt much better before.
Fabien
--
Fabien Potencier
Sensio CEO - Symfony lead developer
sensiolabs.com | symfony.com | fabien.potencier.org
Tél: +33 1 40 99 80 80
On 3/30/11 2:44 PM, Henrik Bjornskov wrote:
You are completely right. The only thing holding people back from doing
this is the best practices saying a bundle should be named as
"VendorName\NameBundle" with the "Bundle" suffix to better seperate
bundles from actual components.
Since we have removed the "Bundle" when referencing a bundle from inside
a template, configuration, doctrine, etc. i would propose to change the
Best Practices to _not_ encourage the "Bundle" suffix so a Bundle would
be named as "VendorName\Name\NameBundle.php" this way when referencing a
bundle it is clear in what folder you should look for template etc.
Another pro is that bundle would look like other Components / Pear
projects and encourage developers to share and use them even more even
in projects outside the Framework. This would bring a huge benefit to
MenuBundle as it is too small to be an actual component but really
useful even when not using Symfony. If people dont like the additional
Symfony specific files that comes with it, they can delete them or use a
subtree merge.
For third party bundles the categorization will not have any confusions
because the best practice for installing those are in the vendor/bundles
directory at least for the standard distribution.
What do others feel about this ?
If the above is completely out of the question then i want to support
adding the Bundle suffix back.
On Wednesday, March 30, 2011 2:24:38 PM UTC+2, beberlei wrote:
Your namespace does not have to contain the Bundle name, it could be:
Acme\Foo\Entity\Bar
Acme\Foo\Entity\BarRepository
The "Bundle" prefix is completly unnecessary there.
The only place where bundle IS encouraged (but even there not necessary
technically afaik) is in the Bundle class:
Acme/Foo/AcmeFooBundle.php
The confusion only steems from bundles not having updated their
namespaces.
gretings,
Benjamin
On Wed, 30 Mar 2011 05:19:06 -0700 (PDT), Albert Jessurum
<[email protected]> wrote:
> First of all. Please don't kill me :)
> I want to propose to add the "Bundle" suffix back to the
shortname (if
my
> arguments below are correct), and here is my reasoning:
>
> I supported the removal of the Bundle suffix when the decision was
taken,
> up
> until yesterday, when I upgraded to PR9, and saw there will be some
> inconsistencies with namespaces which might be confusing to users. If
the
> suffix stays off, this have to be made very clear to users.
>
> Namespaces are the only place where the Bundle suffix is still
applied,
> and
> can't be taken off [1]. So unless the Bundle suffix is actually
removed
> from
> the Bundle names, which I know won't happen, and makes even less
sense
to
> remove, there will be inconsistencies left on calling xyz vs
xyzBundle
in
> the following places, which are all namespace related:
>
> - Namespace declarations, obviously
> - Entity relationships from another
> bundle: @orm:ManyToOne(targetEntity="Acme\FooBundle\Entity\Bar")
> - Entity Repository Annotations:
> @orm:Entity(repositoryClass="Acme\FooBundle\Entity\BarRepository")
> - Queries:
> - shortname: $em->createQuery('SELECT b FROM AcmeFoo:Bar
> - longname: $em->createQuery('SELECT b FROM
> Acme\FooBundle\Entity\Bar
>
> I don't know if I left anything off.
>
> This is not meaning to create an argument, and I'm fine either
way the
> decision is taken. Just want to put this forth, to make sure we
are all
> fine
> with this.
> If we have to change back, like it happened with the html.twig vs
> twig.html
> issue, now is better than any other time. This is why PRs are
created,
to
> test things out in the "real world", though I know this changes are
> painful
> sometimes :)
>
> ------
> [1] We comply with the PSR-0 standard -
>
https://groups.google.com/d/msg/symfony-devs/l4Cqr35cxK4/DG4L0ke9H7IJ
<https://groups.google.com/d/msg/symfony-devs/l4Cqr35cxK4/DG4L0ke9H7IJ>
--
If you want to report a vulnerability issue on symfony, please send it
to security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en