开发者

Sharepoint development - multiple webparts in same solution, or project for each?

开发者 https://www.devze.com 2023-01-28 05:43 出处:网络
I\'m working on a Sharepoint 2010 project that has quite a few visual webparts. Currently I have all web parts in the same solutio开发者_StackOverflow中文版n. My colleague is working on the same proj

I'm working on a Sharepoint 2010 project that has quite a few visual webparts.

Currently I have all web parts in the same solutio开发者_StackOverflow中文版n. 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?

thanks.


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:

  1. much faster deployment and testing of your code changes <- you don't have to deploy all the webparts everytime you make a single change.
  2. 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.
  3. 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.
  4. 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.


All in one project unless there's a good reason to break them out (i.e. they need to be delivered separately).


It is about deployment. A single project results in a single wsp file, so if you want to deploy all web parts together, stick to the single project. Otherwise, split them up as appropriate.


If its a big project, a seperate project for each webpart could be an overkill. Unless there is a good reason (such as deployment), all should be in same project.

0

精彩评论

暂无评论...
验证码 换一张
取 消