views:

193

answers:

3

So here is a project outline, I need to make a web application with its core components encapsulated in Web User Controls. The reason for this is that the company will be using MOSS extensively by early next year, and we want to use these components later on as web parts. I think these web user controls will need to be flexible in terms of the data source, theme/CSS. We might have a WCF service that will databind to these controls, what are the things I should take into consideration seriously?

I am willing to provide more detail if requested.

Thanks in advance !!

EDIT: MORE DETAIL

Scenario: User Control A is built to consume WCF service A. Now I need to make sure the control will still work if WCF service URI changes and also needs to handle a potential change in the ServiceContract.

A: 

I've used Properties extensively in configurable User Controls, and that has worked well. You can set the control's properties in the container pages, and the dynamically set up the control.

It's also important to note that you need to move most of your control's code (i.e., the VB.Net/C# code in the CodeBehind file) to the PreRender event. You can set the control's properties in the container page's PageLoad event.

david.mchonechase
+1  A: 

More detail would be useful.

Have you considered building WebParts? These may be closer to the model you need for the migration to SharePoint. WebPart properties can be edited through the browser.

If the backend for your application is going to be a WCF service then this should be easy to migrate. Depending on how you handle security you might need to do some testing to see if authentication works well from the SharePoint environment. Components in SharePoint may be running with different credentials.

Study how web parts are styled in SharePoint and what CSS is loaded by your SharePoint environment and piggyback on what you can today. The styling in SharePoint is fairly consistent.

BrianLy
We dont have MOSS ready yet, so cant go about building Web Parts. Also, user controls will give a better dev exp, users accustomed to using the control will find it easy if they see the same on the MOSS site. Right?
Perpetualcoder
WebParts are part of ASP.NET 2.0 and above, so based on your post you do have access to these.
BrianLy
Should have said, read the first link I in my original posting for info.
BrianLy
+1  A: 

The additional scenario information allows for a better answer. In fact your question is really not related to whether you are building with SharePoint WebParts or ASP.NET, it's about how to consume WCF services in a maintainable way.

  • Consider following a WSDL first design approach with WCF. A google search yields a lot of info.
  • Store the URLs somewhere other than hard coded in your application and follow the other posters advice to set these via properties.
BrianLy