Tag Archives: developer

Three points to consider when using the SharePoint BCS

The SharePoint Business Connectivity Services (BCS) is an integration feature of SharePoint 2010 which provides read/write access to line-of-business data in external systems. Once an external system has been modelled in the BCS, a SharePoint user or developer can compose solutions that use external data directly without having to possess expert knowledge about the API of the back-end system.

There are many options when it comes to architecting a SharePoint solution that is integrated with an external system. In some scenarios the BCS will be a valuable constituent of a solution, in other cases it may not be a good fit. If you are looking to connect SharePoint with an ERP system or other line-of-business system, there are some important points to consider when deciding whether the BCS should be part of your solution architecture.

Up to 20 operations need to be supported
The BCS provides a back-end neutral framework for integration by requiring the API of the back-end system to be mapped to 20 stereotyped operations. Many APIs of business applications are not very BCS-friendly and it may require substantial effort to distill the APIs into services that can be mapped to the stereotyped BCS operations. This is not a problem when connecting to simple data sources like SQL Server databases, but more complex business applications often have APIs that are very hard to decipher for outsiders (e.g. SAP has a very granular generic API which presents a significant challenge in this regard).

Data is retrieved on-demand
Business data accessed through the BCS is exposed through what is called external lists in SharePoint. These external lists share many of the characteristics of the traditional SharePoint lists. However, one important difference is that the data is not stored in SharePoint. This is often a positive thing because you generally do not want to replicate business data across multiple storages unless you have to. But there are also common scenarios where data caching is required. For example, the administrator of your ERP system might not be too happy if you are frequently hitting the system live to retrieve data that rarely changes.

Workflows cannot be associated with external lists
SharePoint workflow generally works by reacting to items in a list being added or changed. Items in external lists are fetched on-demand and are not stored in SharePoint and therefore workflows cannot be directly associated with external lists. If you consider a use case where you want to trigger a business process every time a new item is added to a table on the back-end then the BCS is not a good option. You can still query data in an external list as part of a workflow running on a document library or an “internal” list, but items in an external list cannot be the primary object of the workflow.

These are all important things to consider when deciding whether the BCS should be part of your solution architecture. There are solutions where the BCS is a natural fit and there are solutions where you will have to come up with an alternative way of bringing the line-of-business data into SharePoint. As always, if you have any experiences with this please share your thoughts below.

Read More

SharePoint 2010, ALM and Continuous Integration Resources

When teaching SharePoint 2010 developer classes I typically get at least one question every other class as it relates to ALM. On occasion there is at least one student who is used to doing continuous integration (CI) in their non-SharePoint projects and want to know how to it in SharePoint 2010 projects.

For me, the best person you can look to is Chris O’Brien. Chris has done a ton of work around this and has presented on the subject at a few conferences. He’s now working on a blog series (in conjunction with Microsoft folks like Kirk Evans & Mike Morton) that walks though setting up a SharePoint 2010 project for CI. The series is being posted on Chris’ blog as well as SharePoint Developer Team Blog.

Its best to start with the introduction “why” posts here:

» Chris O’Brien: SharePoint 2010 Continuous Integration – Part 1: Benefits
» SharePoint Dev Team Blog: Continuous Integration for SharePoint 2010 (Mike Morton)

Both of those point to the other posts in this series. There are a few other posts on Chris’ blog I’d recommend you check out as well.

Read More

SharePoint 2010 Developer Dashboard for Debugging Code

The developer dashboard is great for debugging web parts just by turning it on. There are also a few simple API calls you can use to add your own debugging information.

First turn it on

First make sure you have an elevated administrator prompt. You need to right click and say run as administrator to get this. There’s no error from STSADM if you aren’t elevated, it just wont perform the operation.

CD \Program Files\Common Files\Microsoft Shared\Web Server Extensions\BIN

STSADM –o setproperty –pn developer-dashboard –pv OnDemand

I remember it as developer dash dashboard so I get the –pn option right. The –pv option is case sensitive.

Once it’s turned on here are a few API calls you can use to output information.

Add a timed method scope in the left pane

This will add the text Some timed scope and it will list the number of milliseconds that the scoped code takes on the developer dashboard left pane.

using (SPMonitoredScope sc = new SPMonitoredScope(“Some timed scope”))
  // some code in here that you think may take time

Add a log, warning or assert message

This will add a message on the right side and at runtime you can click on the counter to see the detailed long message and a call stack. The call stack can add 2 or 3 Kb to your web page download so bear in mind this can significantly increase your time to page render if you have hundreds or thousands of these on a page and developer dashboard is turned on.

SPCriticalTraceCounter.AddDataToScope(uCounter, “Your category”, traceLevel, “Detailed long message”);

The traceLevel interprets the following to strings in the output:

1 Critical
4 Exception (Watson)
6 Assert
8 Warning
10 Unexpected
15 Monitorable

Read More

SharePoint Sideshow – Building a SharePoint Development Machine Using the Easy Setup Script

  Watch now: http://bit.ly/SPSS-EasySetupScript SharePoint Easy Setup Script is a new tool released by Chris Johnson and Paul Stubbs to help you set up a SharePoint 2010 developer machine without requiring Hyper-V. The Easy Setup script will set…(read more)
Read More

SharePoint 2010 Developer Virtual Labs Online

Three new MSDN Virtual Labs are live running SharePoint Server 2010 and Visual Studio 2010. You can work on these labs and learn SharePoint 2010 development without having to install SharePoint 2010 or Visual Studio 2010 on your machine. All you need is a web browser that can support our remote desktop ActiveX control and you can run these labs on our servers.


MSDN Virtual Lab: Developing a Visual Web Part in Visual Studio 2010

After completing this lab, you will be better able to work with existing Web Parts and Linq and also you will be more familiar with connecting two web parts.

MSDN Virtual Lab: Developing a BCS External Content Type with Visual Studio 2010

After completing this lab, you will be better able to build a BCS External content type, create a Business Data Catalog Model project, configure the External Content Type for offline use, and open the list using Outlook.

MSDN Virtual Lab: Developing SharePoint 2010 user interface with Silverlight in Visual Studio 2010

After completing this lab, you will be better able to create a basic Silverlight application that displays a SharePoint list inside a datagrid and deploy the Silverlight application to SharePoint, and also create a Silverlight application that displays SharePoint list data in a graph using the Silverlight Graphing controls.

Read More

SPTraceView – Easy overview of the SharePoint logs (ULS logs)

Author: Tobias Zimmergren http://www.zimmergren.net | http://www.tozit.com | @zimmergren Introduction If you are a SharePoint developer, you often need to dig into the logs in the 12-hive in order to find out why things are behaving the way they are. You and me both know that this can be a pa … (More)
Read More