The architecture of BCS is comprehensive but still
makes it easy to use. Considering that BCS can be used for both
SharePoint and the MS Office clients, it offers an excellent framework
that enables administrators to easily understand and set up BCS
solutions that integrate content types from most typical content sources
all the way through the pipeline of BCS, finally presenting a data
interface in an intuitive way to the end user. Furthermore it allows
developers to create new, reusable components as either .NET connectors
or custom connectors. BCS can be divided into three layers:
presentation, core components, and content sources, as shown in Figure 1.
1. Presentation
BCS presents data that can be
consumed or manipulated by SharePoint 2010 and MS Office clients.
SharePoint 2010 contains three primary consumers of data exposed through
BCS.
External lists
Out-of-the-box Web Parts
Search
1.1. External Lists
SharePoint contains a new list
type named external lists. This list acts as any other list, with the
exception that an external content type must be defined for the list. It
does not support version info and alerts, however, as its data is
stored externally.
1.2. Web Parts
BCS Web Parts are similar to
those found in BDC for SharePoint 2007. Although BCS is included for
free in SharePoint Foundation 2010, BCS Web Parts are included only in
the SharePoint 2010 Enterprise edition. Included Web Parts are
Business Data Actions
Business Data Connectivity Filter
Business Data Item
Business Data Item Builder
Business Data List
Business Data Related List
1.2.1. Business Data Actions
Actions are executed on
single results from BCS. The concept is also known from search centers
with result actions, which are context-specific actions, such as opening
documents in their native application or opening a web page in a new
window—in short, actions that differ based on the specific result.
Actions are configured by specifying a target URL of an HTTP handler, .aspx
page, or similar. By adding parameters to the URL, an action can be
constructed such that the URL can invoke a translation using the Bing
translation service, looking up addresses on Bing Maps, or even invoke
special purpose functionality if a custom HTTP handler or .aspx page is implemented and deployed. The configured actions for a BCS result are displayed in the Business Data Actions Web Part.
1.2.2. Business Data Connectivity Filter
The Business Data
Connectivity Filter Web Part is used to perform data filtering of
SharePoint Web Parts based on values passed from the Business Data
Connectivity (BDC) Filter Web Part. A number of filters are included,
allowing manual input such as text or date and time, values picked from a
list of choices, or fixed values either defined for the site or passed
by URL. If a filter exists on a page, the Connections option becomes
available on the Edit page. This allows for creating an association or
connection between a filter and, for instance, a list view or data view
Web Part. This way selected data columns will be filtered based on the
defined filter values to show a custom view for a department, user, KPI
event, etc.
1.2.3. Business Data Item
The Business Data Item Web
Part shows a single result in a vertical view. A typical use is to show
detailed or expanded data of a particular result row from a summarized
Business Data List Web Part. The Business Data Item Web Part can be
connected to the Business Data List Web Part and respond to selected
rows.
1.2.4. Business Data Item Builder
This Web Part is used to pass a
unique identifier from the URL parameter to the Web Parts on the page.
Using this Web Part, it is possible to pass the unique identifier across
pages containing Business Data Item Web Parts.
1.2.5. Business Data List
This is a grid view Web Part
and the core display method for BCS data, allowing an overview of the
LOB data obtained from a BCS source. The key feature is the connection
option that allows this Web Part to be connected to detailed view Web
Parts and otherwise used for filtering and/or custom actions by clicking
a result row.
1.2.6. Business Data Related List
Sometimes a particular
result from one external content type has associations to data in
another external content type. The Business Data Related List Web Part
is used to show the "many" part of the relationship by using values from
other BCS Web Parts or URL-based identifiers to look up associated data
for the external content type defined for the Business Data Related
List Web Part.
1.3. Search
Search results originating
from BCS are displayed in a page called the profile page, when the BCS
result item gets clicked or opened. The profile page is an .aspx
page built with BCS Web Parts. The Web Parts display the relevant BCS
entity based on the entity's ID, which is passed to the profile page as
URL parameters. Multiple profile pages can be created to accommodate
different external content types.
Profile pages are
not created automatically for an external content type. Per default,
clicking a search result from a BCS source yields the well-known 404
error (page not found). The profile page must be created and configured
from the Search service application.
NOTE
Searching for external content using BCS is available only in SharePoint 2010 Standard and Enterprise versions.
2. Core Components
The core of BCS is the
ability to connect to a large set of data sources using its connector
framework. By defining content types from the data sources, the runtime
engine is able to execute CRUD operations on these content types. The
core components are
Runtime engine
BCS Rich Client Cache
Connectors
External content types
The runtime engine is
responsible for executing BCS operations on the content sources. The
runtime engine is integrated into the supported office applications,
SharePoint workspace, InfoPath, and, of course, SharePoint 2010. The
integration into these applications makes them independent of SharePoint
2010 as a middle layer for using BCS to connect to content sources.
2.1. BCS Rich Client Cache
Business Connectivity
Services offers cache and offline features that also support cache-based
operations. For users that work with solutions deployed to supported
Office 2010 applications (Word, Outlook, SharePoint 2010 Workspace,
etc.), they can manipulate external data, even when they are working
offline or if the server connectivity is slow or unavailable. The
operations performed against cached external entities are synchronized
when connection to the server becomes available. It also provides a
flexible external data caching mechanism that is as transparent as
possible while still enabling the user or application to have explicit
control over the content of the cache when required via automatic and
manual cleanup.
2.2. Connectors
The BCS connector framework
in SharePoint 2010 comes with built-in support for creating external
connections to SQL, WCF, and .NET assemblies. In general this covers the
majority of connection requirements. It would have been nice, however,
if a flat file or .xml connector
was built in as well. Fortunately the BCS connector framework is
designed to be extendable with either custom connectors or custom-made
.NET connectors.
2.3. External Content Types
External content types are the
glue of BCS. They describe the metadata definitions of the external
content data, connectivity information, and data access capabilities.
This way an ECT provides a reusable schema to be used in SharePoint
lists and Web Parts.
The external content type is
what the IT professional creates in SharePoint Designer 2010. A typical
business requirement for an IT professional is to create an ECT for a
customer database. This database might contain names, addresses, payment
info, and a unique customer ID. When the IT professional creates an ECT
for this data source, the ECT will contain both the column definitions
for the required fields as well as names and optionally credentials for
the customer database. It will also contain information on which CRUD
operations can be executed on the customer database. From the IT
professional's point of view, an ECT is a mapping between the external
data source and SharePoint 2010. The key difference from BDC in
SharePoint 2007 is that the ECT now also contains the full CRUD
behavior, whereas in BDC it had to be programmed.
Behind the scenes, an ECT is an .xml
grammar file containing metadata that describes the ECT. For the ECT to
be available, it has to be deployed to the metadata store in SharePoint
(or through a click-once package, e.g., Outlook 2010).
Depending on the
capabilities of the data sources and connectors, it is possible to
create an ECT that provides easy data access with complex logic, such as
aggregating data across multiple sources, providing complex
transformations, evaluating complex business logic or custom security
requirements, or calling systems multiple times in order to provide a
single view of data.
3. Content Sources
Content sources are the
external part of BCS. They are used by the search engine to index
external data. As mentioned, BCS comes with built-in support for
connecting to content sources of the types SQL, WCF, and .NET
assemblies. Often the content source is made available through
installation of Microsoft SQL Server or a data server program that can
be accessed and controlled through WCF. In more advanced cases, the
content source might provide a .NET API for performing these operations.
On some occasions, the
content source does not provide any of the foregoing options for
interfacing with the data. In these cases, a developer has to develop
either a .NET Assembly Connector or create a custom connector for BCS.