Skip to content

Commit

Permalink
Add Implementor's Guide
Browse files Browse the repository at this point in the history
Fixes servicebinding#101

Signed-off-by: Baiju Muthukadan <[email protected]>
  • Loading branch information
baijum committed Jun 30, 2021
1 parent 2dceb46 commit 824b02e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/implementors-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Implementor's Guide

## Purpose of the type and the provider fields in the application projection

Service Binding specification mandates `type` field and recommends `provider` field in the binding Secret resource. The provider field is recommended to support scenarios where there could be different providers for the same Provisioned Service type. For example, if the type is `mysql`, the provider value could be `mariadb`, `oracle`, `bitnami`, `aws-rds`, etc. When the application is reading the binding values, if necessary, the application could consider `type` and `provider` as a composite key to avoid ambiguity. It will be helpful if an application needs to choose a particular provider based on the deployment environment.

The language binding API can create two separate functions to retrieve bindings (with provider and without provider). For example, in Go:

```
GetBinding(_type string) (map[string]string, error)
GetBindingWithProvider(_type, provider string) (map[string]string, error)
```

Languages with parametric polymorphism can use a method with different parameters to retrieve bindings (with provider and without provider). For example, in Java:

```
public List<Binding> filterBindings(@Nullable String type)
public List<Binding> filterBindings(@Nullable String type, @Nullable String provider)
```

(Example taken from [Spring Cloud Bindings](https://github.com/spring-cloud/spring-cloud-bindings))

0 comments on commit 824b02e

Please sign in to comment.