I'm working on a Sharepoint 2010 project that has quite a few visual webparts.
Currently I have all web parts in the same solution. My colleague is working on the same project, but is creating a project for each web part inside the solution.
What's the best practice here? What are the advantages/disadvantages of each approach?
I tested both approaches when I started developing Sharepoint solutions and I conclude the following Pros / Cons:
Pros of having separate project for every webpart:
- much faster deployment and testing of your code changes <- you don't have to deploy all the webparts everytime you make a single change.
- easier and better team collaboration <- usually every developer works on a single webpart this way, everyone's code is separated and there won't be checkin/checkout conflicts.
- better code reusability, if you needed at any time in the future to use a single webpart in another project you will find it much easier to just go and get the webpart project.
- All webpart resources in a single place, usually the webpart uses some resources (resx / images) which you can include in it's project, imagine having a big solution and all the resources of all webparts are spread around in a single project, it's much harder to just get your webpart to use it in another future project because you have to find all related resources.
I hope that's enough to let you enjoy the Webpart per project appreach.