Reputation: 31548
I am new to symfony and my project is to build a complex web application in symfony.
There will be many small features like pdf export, xls export, document upload which can be used in future projects.
But I am not sure whether I should make separate bundles for pdf, xls, image upload or what.
All I want is that I can reuse the classes. How should I do this?
Upvotes: 1
Views: 226
Reputation: 529
It depends. There is some people who thinks that EVERYTHING goes into a bundle. Personally i think this is wrong, and that the right approach would be to develop small component and have bundles integrate them into the Framework, just like what FrameworkBundle, SecurityBundle etc. does.
For examples on small components you can checkout Vandpibe. Which is just small components/bridges for Symfony2 components.
Upvotes: 1
Reputation: 6927
Start with everything in one bundle. Especially if you do not plan to redistribute the bundle. Using proper separation of concerns when developing your classes will be enough reusability for any of your own projects. You can use namespacing within a single bundle to organize even more. Prematurely separating your project into bundles will add unneeded complexity and there's little, if any, advantage. Save it for a refactor down the road when/if the need for bundles becomes more apparent.
Upvotes: 1