-
Notifications
You must be signed in to change notification settings - Fork 1
Interfaces
Martin Halliday edited this page Nov 4, 2016
·
15 revisions
The OWIN Framework comprises a set of interfaces and a pipeline builder. The pipeline builder knows how to resolve dependencies and use routing to split and join the OWIN Pipeline into multiple paths.
If you have ideas for extending the OWIN Framework with other interfaces please contact the author. Please do not submit a pull request without discussing your ideas with the author first.
The OWIN Framework interfaces are versioned. The versioning scheme has these characteristics:
- The core interfaces that are consumed by middleware and not implemented by them are not versioned.
- All interfaces designed to be implemented by middleware or facility are versioned.
- Each version of an interface inherits from the previous version. If you check whether an object implements a specific version of an interface you are also checking if the object implements any higher version of that interface because these higher versions inherit from the lower versions.
- Versions are implemented in the namespace name not in the interface name. This means that you can update your code to a newer version by just changing the
usingstatement. - You should always implement the most recent version of the interfaces.
- When checking if another object implements an interface, check for the lowest interface version supported by your code.
| Interface | Description |
|---|---|
| IBuilder | The pipeline builder builds the OWIN pipeline |
| IConfiguration | Defines the mechanism for configuring middleware |
| IDependency | Encapsulates a dependency between two middleware components |
| IMiddleware | All middleware must implement the IMiddleware<T> interface |
| IUpstreamCommunicator | Middleware implements this when they provide upstream communication |
| IRoute | Routing components implement IMiddleware<IRoute>
|
| IRouter | Inherits IMiddleware<IRoute> and adds methods for creating and enumerating routes |
| IRoutingProcessor | Implemented by middleware that takes part in the routing phase of request processing |
| IRoutingSegment | A collection of middleware that are on the same segment of the routing graph |
The first version of the versioned interfaces are:
| Interface | Kind | Description |
|---|---|---|
| IAnalysable | Capability | Indicates that the middleware has the capability to generate analytics |
| IConfigurable | Capability | Indicates that middleware has the capability to be configured |
| ISelfDocumenting | Capability | Indicates that middleware has the capability to produce documentation |
| ICache | Facility | A facility for storing temporary data that is shared by all of the web servers. |
| IIdentityStore | Facility | A facility for storing and checking identities |
| ITokenStore | Facility | A facility for generating and checking opaque tokens |
| IAuthorization | Middleware | Middleware that implements IMiddleware<IAuthorization> provides an authorization mechanism |
| IIdentification | Middleware | Middleware that implements IMiddleware<IIdentification> provides an identification mechanism |
| IOutputCache | Middleware | Middleware that implements IMiddleware<IOutputCache> provides an output caching mechanism |
| IPresentation | Middleware | Middleware that implements IMiddleware<IPresentation> provides a presentation mechanism |
| ISession | Middleware | Middleware that implements IMiddleware<ISession> provides a session mechanism |
| IUpstreamAuthorization | Upstream | Middleware that implements IUpstreamCommunicator<IUpstreamAuthorization> to provide an upstream communication mechanism for downstream middleware to control the authorization middleware |
| IUpstreamIdentification | Upstream | Middleware that implements IUpstreamCommunicator<IUpstreamIdentification> to provide an upstream communication mechanism for downstream middleware to control the identification mechanism |
| IUpstreamOutputCache | Upstream | Middleware that implements IUpstreamCommunicator<IUpstreamOutputCache> to provide an upstream communication mechanism for downstream middleware to control the output caching mechanism |
| IUpstreamSession | Upstream | Middleware that implements IUpstreamCommunicator<IUpstreamSession> to provide an upstream communication mechanism for downstream middleware to control the session mechanism |