Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Latest commit

 

History

History
60 lines (36 loc) · 3.28 KB

extensibility.md

File metadata and controls

60 lines (36 loc) · 3.28 KB

Extensibility with the Microsoft Graph SDK for Android

The Graph SDKs are built to allow for customization and enhancement over time while maintaining backwards compatibility.

Contribution

Contributions are welcome on the Microsoft Graph SDKs. To contribute, please open a new issue to start a dialog with the team about what you are creating.

Note There is an area of the SDK which is not available for direct contribution, which is anything under the com.microsoft.graph.generated package. These components are built using automated tools and will be overwritten. For advanced users the automated tool, MSGraph SDK Code Generator, is available to make updates to the generated templates used in this project.

Minor modification

Graph's service is described in accordance with OData. This service description is available and continuously updated as new features become available. However, the Graph $metadata description does not encompass all features and functionality. To aid with elements of the service that are not described here, the com.microsoft.graph.extensions package was created. The files are all generated automatically but will not be overwritten. Some functionality is already exposed in this manner, and here is example using the GraphServiceClient.

The class hierarchy:

class GraphServiceClient extends BaseGraphServiceClient implements IGraphServiceClient {}
class BaseGraphServiceClient extends BaseClient implements IBaseGraphServiceClient {}
class BaseClient implements IBaseClient {}

The companion interface hierarchy:

interface IGraphServiceClient extends IBaseGraphServiceClient {}
interface IBaseGraphServiceClient extends IBaseClient {}
interface IBaseClient {}
  • The BaseClient layer represents the under-pinnings of an OData client. These objects are open for modification and additions.
  • The BaseGraphServiceClient layer is supplied by the OData $metadata description, and is automatically populated with the features described therein.
  • The GraphServiceClient layer is where extra functionality above and beyond the $metadata description can be placed.

The Microsoft Graph team keeps the interfaces up to date to detect backwards compatibility breaking changes.

Most classes generated at this 'top tier' will be empty to support future modification.

Major dependencies

During the construction of the IGraphServiceClient object an IClientConfig is used. This configuration determines how the internal functionality of the SDK is supplied. By creating a new IClientConfig implementation the components can be modified or wholly replaced to best meet the needs of the caller.

IHttpProvider

Provides the http fabric that is used for all network requests within the SDK.

IAuthenticationProvider

Provides the facilities to supply an authentication token for requests to the service.

ISerializer

Serializes and deserializes the structured object from the service.

IExecutors

Handles executing tasks for the SDK on foreground and background threads.

ILogger

The logging system used by the SDK to report debug and error messages for debugging purposes.