Solution Overview

Solution Overview

This topic provides a high-level overview of the various components that make up the Client Reference Implementation (Client RI). It does not examine the design of the solution or the implementation details of specific features, as these are described later in this guidance. Instead, it illustrates how the reference implementation works at a conceptual level.

The Client RI uses SharePoint lists as its underlying data source. The data model was implemented in the same way as the SharePoint List Data Models reference implementation, and is not described again here. Instead, this documentation focuses on the implementation of user interfaces and data access mechanisms in client-side logic. The Client RI includes eight different client implementations that demonstrate various approaches to client-side SharePoint development. The following image shows a Silverlight implementation that uses the client-side object model (CSOM) as its data access mechanism. This builds on the SharePoint List Data Models RI scenario of managing inventory locations and suppliers for machine parts.

The Client RI user interface


As you can see from the Client RI user interface in the image above, the solution adds links to all eight implementations to the Quick Launch bar on the left-hand side of the page. Each implementation explores a different approach to a similar scenario. Each illustrates how you can use client-side logic to provide a richer user experience and to avoid some of the limitations of the sandbox execution environment. Not all of the interfaces look identical, even where they implement the same scenario, as they rely on different UI technologies. The following list provides a summary of each implementation:

  • The Silverlight CSOM, Silverlight REST, Ajax CSOM, and Ajax REST interfaces all implement the machine parts inventory management scenario described by the SharePoint List Data Models RI, which must be installed as a prerequisite for the Client RI. This allows you to compare and contrast the use of Ajax and Silverlight as a platform for user experience, and the use of the CSOM and the REST interface as client-side data access mechanisms.
  • The Silverlight SP Service interface implements a subset of the machine parts inventory management scenario, using the SharePoint ASP.NET (ASMX) Web services as the client-side data access mechanism. This allows you to compare the ASP.NET Web services found in the previous version of SharePoint to the new CSOM and the REST interface. The SharePoint ASP.NET Web services are useful as they provide backwards compatibility for SharePoint 2007 applications, and they expose some functionality—such as the user profile service—that is unavailable through the CSOM or the REST interface. However, you should favor the use of the CSOM or the REST interface wherever possible.
  • The Silverlight REST Alt interface demonstrates an alternative approach to the machine parts inventory management scenario. This approach retrieves inventory locations on demand to improve the overall efficiency of the implementation.
  • The Silverlight REST Alt No MVVM interface demonstrates an approach to the machine parts inventory management scenario that does not use the Model-View-ViewModel (MVVM) pattern. Every other Silverlight interface uses the MVVM pattern, which takes maximum advantage of Silverlight's binding and eventing capabilities while maintaining the testability of the code. This implementation is included to help developers understand how to translate between an MVVM and a non-MVVM pattern.
  • The Silverlight External Service interface uses the same approach as the Silverlight CSOM interface to retrieve suppliers, and then retrieves the accounts payable for that supplier from an external Web service. This is the same scenario as the Full-Trust Proxies for Sandboxed Solutions (Proxy RI) reference implementation. However, where the Proxy RI required a full trust proxy to call the external Web service from the server, this interface circumvents the limitations of the sandbox environment by calling the external Web service directly from the client. This allows you to deploy the interface using solely sandboxed solution components.

Browsing the Visual Studio Solution

The Microsoft Visual Studio® solution for the client reference implementation contains seven projects, as shown in the following image.

The Client solution


Six of the seven projects are Silverlight applications that correspond to the interfaces described in the previous topic. They are:

  • The Client.CSOM.Silverlight project is the Silverlight application that provides the Silverlight CSOM interface.
  • The Client.ExtService.Silverlight project is the Silverlight application that provides the Silverlight External Service interface.
  • The Client.REST.Silverlight project is the Silverlight application that provides the Silverlight REST interface.
  • The Client.ExtService.Silverlight.Alt project is the Silverlight application that provides the Silverlight REST Alt interface.
  • The Client.ExtService.Silverlight.Alt.NoMVVM project is the Silverlight application that provides the Silverlight REST Alt No MVVM interface.
  • The Client.ExtService.Silverlight project is the Silverlight application that provides the Silverlight External Service interface.

The Client.SharePoint project is somewhat more complex. This is a SharePoint project that contains the features that deploy all the solution components—such as libraries, pages, images, scripts, and Silverlight XAP files—to the SharePoint environment. These components include the pages and scripts that define the Ajax CSOM and Ajax REST interfaces. This project is described in more detail in the Solution Design topic.

Anatomy of a Silverlight Project

Each of the Silverlight projects contains a similar structure, based around an implementation of the MVVM pattern. For example, the following image shows the structure of the Client.CSOM.Silverlight project.

Silverlight project structure for a Model-View-ViewModel implementation


The key components of this project structure are as follows:

  • The Entities node contains classes that provide a strongly typed representation of business entities such as parts and suppliers.
  • The ViewModels node contains the view model classes for the application, as part of the MVVM pattern implementation. For more information on the role of the view model class, see Implementing the Model-View-ViewModel Pattern.
  • The XAML files provide the declarative component of the Silverlight controls used in the application.

The Client.ExtService.Silverlight project has an additional node, Service References, which contains the components required to interact with the external vendor service.

The Client.ExtService.Silverlight.Alt.NoMVVM project contains no nodes, as all the logic is in the code-behind files for the Silverlight controls. This project provides a non-MVVM implementation of the Client.ExtService.Silverlight project. This implementation requires more code, as it doesn't take advantage of the Silverlight binding infrastructure in the same way that an MVVM implementation does. However, the implementation is easier to follow for developers who are unfamiliar with the MVVM pattern, and it enables developers to compare the two approaches side by side.

© 2016 Microsoft