in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Tommy Segoro

This is Tommy Segoro's blog.

Sharepoint Team Development with Visual Studio 2005 2008 Part 1

INTRODUCTION

Sharepoint 2007 (WSS 3.0 and MOSS 2007) has been a very-very great offering not only that it has so many great out-of-the-box functionalities, but it also allows us to build custom solutions on top of it. Basically, Sharepoint 2007 can be used as a development platform. However, few problems arise when doing team development with Sharepoint. It's not like a classic development methodology where everyone check-in/check-out code into TFS or VSS, and unit tests are applied, etc. With Sharepoint 2007, you just can do the development in so many ways. Microsoft also introduces Sharepoint Designer that allows you to edit ASPX and Master files directly. So, what about Visual Studio? What about source control? Sharepoint Designer has check-in/check-out mechanism. It's a source control application by default and you can also create customizations using Sharepoint GUI directly (creating custom content types, fields, lists, etc)? So how do we follow classic development methodology using Visual Studio if this is the case?

I personally have been involved with 2 types of Sharepoint project:
- Company-supporting application (eg. 1 massive Sharepoint app to support a company such as corporate Intranet)
- Client-based applications (eg. Internet websites)

My approach when doing these projects are quiet different especially when working in a team of developers since each of these projects has its own characteristics. These posts are written based on my experience only so I will appreciate your comments and your sharings of your experience, too. There are so many ways in developing Sharepoint so I would really-really love to hear how everyone is approaching Sharepoint customizations and development.

 

THE PROJECTS

1. Company-Supporting Application
This type of Sharepoint installation will be targeted for internal use only. It's normally used for corporate Intranet where all documents will be stored in Sharepoint. You will only have "1" project but with many features in it. In your source control application (TFS or VSS) you will store different source code for different features that support this massive app. Therefore, you will not have ClientA, ClientB node in it instead you will have something like MiningProjectSiteShell, ProjectDocumentLibraryFeature, etc. The source code is normally stored and owned by the company itself.

Branding is normally not a priority. Your solutions will normally evolve heavily around creating features for deploying workflows, feature receivers, custom lists, list receivers, content types and fields.

2. Client-Based Application
This type of Sharepoint installation is targeted for clients. This type of projects normally occur when you're working in a software development company. You will need to develop applications for clients. Therefore, your source control application (TFS or VSS) will normally have ClientA, ClientB, etc structure. Example of this project will be Internet website using either MOSS or WSS. The source code will normally be owned by the software development company and the deployment of these customizations can be done at client's environment or in a shared hosted environment.

Branding is normally a priority. Your solutions will normally evolve heavily around custom navigation controls (custom drop-down menu, side navigation and breadcrumb), content types, fields, master pages, page layouts.

 

THE CUSTOMISATION APPROACH

No matter what projects you are doing, you should never customize Sharepoint through GUI. I personally will never use Sharepoint Designer to modify master pages and page layouts because as soon as you modify these pages, they will be un-ghosted (ie. linking from file system will be removed) and you will be dependent on Sharepoint Designer from that moment. Same with content types and fields, you should never add a new content type/field through GUI.

You should ALWAYS put every Sharepoint customization into solutions and features! These include (and not limited to) master pages, page layouts, images, CSS, javascripts, content types, fields, list definition, event receivers, feature receivers, list receivers, web parts, etc.

Workflow however is an exception. I will tolerate workflow that is built using Sharepoint designer. Why? Because you can create SIMPLE workflow easily through Sharepoint Designer. The reason why workflow is an exception is because the only way for you to create workflow that can be deployed through feature is when the workflow is created using Windows Workflow Foundation and it can be very complicated. For simple workflows, Sharepoint Designer is allowed. For best practice however, still tries to develop and deploy workflow using WWF and features. That is to move away from Sharepoint Designer especially if you're thinking of modifying the workflow, updating the way it works, etc it will be best done using WWF, features and solutions.

Another reason why GUI customization should be prohibited is because, imagine that you have a team of 5 developers and each one of them has Sharepoint installed on their local PC/laptop. One developer needs to add a content type, how can that content type be replicated to the other PCs? The other developer needs to re-create that content type manually and worse, every developer has to keep track of what they change. If you miss one thing, that's it.....

I used to try to solve the above problem by using a shared development machine. So everyone connects to one PC that has Sharepoint in it. Fine...it solves the problem. One developer adds a new content type, the other developers can see it. But another problem arises. What if someone wants to debug his web-part? Remote debugger is attached. Once remote debugger is attached and the break point is hit, that machine suddenly stops working and other developers won't be able to even access the site and even worse, you can't attach more than 1 remote debugger at a time.

So the only approach left is, to build EVERYTHING using features and package them up into solution. You will then deploy the solution and Sharepoint will take care of copying the files to the correct location (the DLL to GAC, site templates to 12 Hive, etc). With features, you can now develop the customizations in Visual Studio, add them to source control app (VSS or TFS), you can also check-in/check-out as per normal development and everyone can get latest and upload the latest solution to their local development machine, you can schedule build, etc etc etc. There are just so many benefits of using features.

The disadvantage is however, it may take some time to setup features in Visual Studio. But it's worth it (at least it is from my experience).

 

THE DEVELOPMENT ENVIRONMENT APPROACH

I personally will install Windows Sharepoint 2003 and MOSS 2007 on every developer machine and I'm not a big fan of development using Virtual PC. The reason is, productivity. This is one and the only reason I have for not using VPC. Since the customizations will now be developed using features (and the features will be installed for a particular client Sharepoint app anyway), you can have multiple websites extended with Sharepoint on your local IIS, can't you? And it's just so much more efficient. VPC can be slow at times.

I've developed Sharepoint (both MOSS and WSS 3.0) for more than 10 clients and every time I want to modify something for a particular client I just go to my local IIS with customized HOSTS file eg. http://client1, http://client2 and I can access each client Sharepoint application on my local PC straight away rather than opening a VPC that corresponds to a particular client. It's really-really quick and I save so much space by not using VPC.

 

CONCLUSION PART 1

So....that's my experience in developing Sharepoint app for clients. In the next part I will share with you how I develop customizations using features, Visual Studio and source control and how I normally work in a team. Thanks, please share your experience.

Comments

 

Tom Clarkson said:

I've had to set up these processes for several clients, and you make a couple of points I disagree with.

First, the designer workflows - Aside from the stability and migration issues, they limit what you can do quite a bit. Workflows often start out simple enough for designer, but sooner or later the client inevitably asks for one little change that isn't possible in designer. You're better off setting up a set of templates/samples to make developing visual studio workflows really easy.

The other point is that virtual machines give better productivity if done right. The performance issues largely go away if you have plenty of memory and use an external drive (I keep the read only base vm on a 32GB flash drive). You lose very little time if you completely break a vm, and there's definitely something to be said for only having to install sharepoint and visual studio once for the entire team.

September 3, 2008 11:15 PM
 

tommysegoro said:

Hi Tom, thanks for your sharing.

September 3, 2008 11:29 PM
 

Jeremy Thake said:

I agree with tom on the SharePoint Designer worklfows, deploying these and also maintaining them is a pain! Best to invest some time in Workflow Foundation, in the long term it's heaps better. For me SharePoint Designer (and InfoPath) are tools for Developers to do proof of concepts and that's it ;-)

I hear Tom's points on time saved with VPC, I guess you just need decent machines to run them on. From working in the environment you're currently in, I can see why you moved away from it as those machines wouldn't handle VPCs!

Good post mate.

September 3, 2008 11:41 PM
 

Links (9/4/2008) « Steve Pietrek - Everything SharePoint said:

Pingback from  Links (9/4/2008) « Steve Pietrek - Everything SharePoint

September 4, 2008 7:58 PM
 

Azeem Anchamparuthi said:

Hi Tommy, Thank you for sharing your experience. I agree with Tom on VPC for development and using Visual Studio for Workflows.

With 4GB Ram in my laptop, my MOSS VPC is running pretty fast. It also depends on the Processor speed, if you have a 2.6+ Ghz dual core, it will be great. I also tested VMWare player which I found is little bit faster than Virtual PC 2007, but I haven't really tested it to tell you the pros and cons.

The company which I'm now working is using Ultimus Workflow which is far more advanced than the SharePoint Workflow. But this is the way I think, as long as you are not utilizing the advanced features of Ultimus, SharePoint work flow would be a good option to consider.

Anyway, waiting for your next Post1

September 7, 2008 4:33 PM
 

Tommy Segoro said:

This is the second part of Sharepoint Development using Visual Studio series. For previous part: http

September 7, 2008 8:25 PM
 

Amreesh Sharma said:

Good Article..

October 10, 2008 7:07 AM
 

Fadi Naffah said:

I agree with TOM on the VM.

waiting Part 2

November 11, 2008 6:58 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

About tommysegoro

My name is Tommy Segoro and I've had 5-year experience in Web Development. I'm involved in Sharepoint and Microsoft CRM development and providing clients with Sharepoint development best practice. I'm currently working as Sharepoint Practice and Technical Lead at L7 Solutions. Regarding Sharepoint, I've been involved heavily with the following aspects of Sharepoint (WSS and MOSS): - Branding Sharepoint (custom site definition, master pages, CSS, custom .NET user controls, etc) - Custom workflow - Custom InfoPath form development - Interfacing Sharepoint with MS CRM - BDC and custom search development that connects to external data source I'm holding MCP and MSCRM Software Advisor certification. Hope that you enjoy reading my blog.

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts