Condividi tramite


Mechanics of Using Business Connectivity Services

Applies to: SharePoint Server 2010

Available in SharePoint Online

To understand the mechanics of using Microsoft Business Connectivity Services (BCS), you need to look at its two most important architectural components: the Business Data Connectivity (BDC) service and the Business Connectivity Services Client Runtime.

Business Data Connectivity Service

The Business Data Connectivity (BDC) service provides, through its central metadata store, a mechanism to store descriptions of the programmatic interfaces of external systems by using:

  • Data structures such as Method, Parameter, TypeDescriptor, LobSystem objects, and LobSystemInstance objects.

  • Information about the external system such as the server name, connection string, and authentication methods.

Methods are contained in an abstraction (entity) that represents an external data type (such as Customer or Order). These methods abstract out complex details about an external system's interfaces, and bring business application development into the realm of information workers. BDC then transforms the external system interface definitions into normalized, stereotypical operations against entities, such as "Create-An-Entity-Instance", "Read-Entity-Instances", and "Check-Entity-Instance-Permissions", by annotating the actual line-of-business (LOB) system interface descriptions with the annotations described by data structures such as MethodInstance, Identifier, FilterDescriptor, and Association. These data structures, collectively named MetadataObjects, comprise the BDC metadata model, a component of BDC. These MetadataObjects are grouped into related collections named models that describe one or more external systems. Models are stored in a metadata store. After a store of models is made available, any solution can access that store by using the BDC Runtime object model, another component of BDC. The BDC Runtime object model provides programming interfaces that make the experience of programming against varied back-end systems uniform. It does this by programmatically converting method calls into stereotypical, normalized operations that are requested by an application into an external system-specific invocation.

The following diagram shows the programming model of BDC.

Figure 1. BDC programming model

BDC programming model

BDC is the foundation of Business Connectivity Services, and the foundation of BDC is the entity model that defines entities, methods, relationships, and so on. After these are defined, the BDC Runtime object model is populated with data and provides a uniform stereotypical operational experience on the data, such as Create, Update, and Finder methods. Assuming that the underlying external system does expose create, read, update, delete, and query (CRUDQ) interfaces, the BDC Runtime object model will provide capabilities to perform these operations without requiring details about the underlying system.

BCS Client Runtime

The Business Connectivity Services Client Runtime acts as a connector between the Business Connectivity Services, Business Connectivity Services solutions, and Microsoft Office host applications. After external data is available in Microsoft SharePoint Server 2010, it can be brought into Office 2010 applications and shown contextually. To do this you must have a way to map the external data described by the metadata model to the different Office application user interface (UI) elements, and then to show those UI elements when it is required, depending on the current context. A run-time engine is needed to load the solution and execute it. The Business Connectivity Services Client Runtime is the run-time engine that connects the Business Connectivity Services, Business Connectivity Services solutions, and Office host applications. Business Connectivity Services Client Runtime loads every time that the host Office application loads, and it raises, listens to, and acts on specific events generated on the host application. The Business Connectivity Services Client Runtime interprets the declarative Business Connectivity Services solutions on Office applications and integrates business data with Office applications. The Business Connectivity Services requires certain application artifacts that tell it how to show external data in the Office 2010 application. These artifacts are part of the Business Connectivity Services solution package. An in-memory Microsoft SQL Server Compact database on the client maintains the metadata and the cached entities that are of interest to the user. This architecture enables solution developers to focus on solving business needs, instead of handling the complexity of interacting with different Office application APIs to perform common and repetitive tasks.

The following diagram shows how the BCS Client Runtime integrates with BDC in Business Connectivity Services.

Figure 2. BCS Client Runtime integration with BDC

BCS Client Runtime integration with BDC