You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -108,13 +108,23 @@ All existing API calls MUST continue to compile and function against all future
108
108
109
109
Languages which ship binary artifacts SHOULD offer [ABI compatibility](glossary.md#abi-compatibility) for API packages.
110
110
111
-
##### Extending Existing API Calls
111
+
#### SDK Stability
112
+
113
+
Public portions of SDK packages MUST remain backwards compatible.
114
+
There are two categories of public features: **plugin interfaces** and **constructors**.
115
+
A plugin interface is an extension point provided by the SDK which is intended to be implemented by end users in order to customize SDK behaviors.
116
+
Examples of plugins interfaces include SpanProcessor, Exporter, and Sampler.
117
+
Examples of constructors include configuration objects, environment variables, and SDK builders.
112
118
113
-
An existing API call MAY be extended without incrementing the major version
119
+
Languages which ship binary artifacts SHOULD offer [ABI compatibility](glossary.md#abi-compatibility) for SDK packages.
120
+
121
+
#### Extending API/SDK abstractions
122
+
123
+
An existing API/SDK call MAY be extended without incrementing the major version
114
124
number if the particular language allows to do it in a backward-compatible
115
125
manner.
116
126
117
-
To add a new parameter to an existing API call depending on the language several
127
+
To add a new parameter to an existing API/SDK call depending on the language several
118
128
approaches are possible:
119
129
120
130
- Add a new optional parameter to existing methods. This may not be the right
@@ -125,17 +135,19 @@ approaches are possible:
125
135
include the new parameter. This is likely the preferred approach for languages
126
136
where method overloads are possible.
127
137
128
-
There may be other ways to extend existing APIs in non-breaking manner. Language
129
-
maintainers SHOULD choose the idiomatic way for their language.
130
-
131
-
#### SDK Stability
138
+
Similarly, existing SDK plugin interfaces MAY be extended with new methods without incrementing the major version
139
+
number if the particular language allows to do it in a backward-compatible
140
+
manner (e.g. by providing default implementations). Hereby, backwards-compatible means that end user's code that implements
141
+
the plugin interfaces MUST continue to be possible to use with newer versions of the SDK without making changes to the end user's code.
142
+
For languages that commonly share code via binary artifacts, e.g. Java, backwards-compatible means that end user's code that implements plugin interfaces MUST continue to be possible to use with newer minor or patch versions without recompiling the end user's code.
132
143
133
-
Public portions of SDK packages MUST remain backwards compatible.
134
-
There are two categories of public features: **plugin interfaces** and **constructors**.
135
-
Examples of plugins include the SpanProcessor, Exporter, and Sampler interfaces.
136
-
Examples of constructors include configuration objects, environment variables, and SDK builders.
144
+
If this backwards compatible addition of methods to interfaces is not possible for a language,
145
+
the language maintainers MAY still implement the addition using backwards-compatible workarounds without incrementing the major version.
146
+
For example, a possible workaround might be to add a new interface instead of extending the existing one and accept the
147
+
new interface in addition to the old one in every place.
137
148
138
-
Languages which ship binary artifacts SHOULD offer [ABI compatibility](glossary.md#abi-compatibility) for SDK packages.
149
+
There may be other ways to extend existing API/SDKs in non-breaking manner. Language
150
+
maintainers SHOULD choose the idiomatic way for their language.
0 commit comments