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
feat: Update documentation for multi-module architecture and improve encapsulation
- Update README.md with comprehensive documentation for new API/SDK separation
- Add clear installation instructions for both API-only and complete SDK usage
- Document architecture benefits and module responsibilities
- Update provider and hook development sections to reference API module
- Make DefaultOpenFeatureAPI package-private with package-private constructor
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Simon Schrottner <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+61-4Lines changed: 61 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,11 @@ Note that this library is intended to be used in server-side contexts and has no
52
52
53
53
### Install
54
54
55
-
#### Maven
55
+
OpenFeature Java is now structured as a multi-module project with separate API and SDK artifacts. In most cases, you'll want to use the full SDK, but you can also use just the API if you're building a provider or need a lighter dependency.
56
+
57
+
#### Complete SDK (Recommended)
58
+
59
+
For full OpenFeature functionality, use the SDK module:
56
60
57
61
<!-- x-release-please-start-version -->
58
62
```xml
@@ -64,6 +68,20 @@ Note that this library is intended to be used in server-side contexts and has no
64
68
```
65
69
<!-- x-release-please-end-version -->
66
70
71
+
#### API Only
72
+
73
+
For provider development or minimal dependencies, use the API module:
74
+
75
+
<!-- x-release-please-start-version -->
76
+
```xml
77
+
<dependency>
78
+
<groupId>dev.openfeature</groupId>
79
+
<artifactId>api</artifactId>
80
+
<version>1.16.0</version>
81
+
</dependency>
82
+
```
83
+
<!-- x-release-please-end-version -->
84
+
67
85
If you would like snapshot builds, this is the relevant repository information:
68
86
69
87
```xml
@@ -81,6 +99,7 @@ If you would like snapshot builds, this is the relevant repository information:
81
99
82
100
#### Gradle
83
101
102
+
Complete SDK:
84
103
<!-- x-release-please-start-version -->
85
104
```groovy
86
105
dependencies {
@@ -89,6 +108,15 @@ dependencies {
89
108
```
90
109
<!-- x-release-please-end-version -->
91
110
111
+
API only:
112
+
<!-- x-release-please-start-version -->
113
+
```groovy
114
+
dependencies {
115
+
implementation 'dev.openfeature:api:1.16.0'
116
+
}
117
+
```
118
+
<!-- x-release-please-end-version -->
119
+
92
120
### Usage
93
121
94
122
```java
@@ -123,6 +151,19 @@ public void example(){
123
151
124
152
See [here](https://javadoc.io/doc/dev.openfeature/sdk/latest/) for the Javadocs.
125
153
154
+
## 🏗️ Architecture
155
+
156
+
OpenFeature Java SDK is structured as a multi-module project:
157
+
158
+
-**`openfeature-api`**: Core interfaces, data types, and contracts. Use this if you're building providers or hooks, or if you need minimal dependencies.
159
+
-**`openfeature-sdk`**: Full implementation with all OpenFeature functionality. This is what most applications should use.
160
+
161
+
This separation allows for:
162
+
-**Cleaner dependencies**: Provider and hook developers only need the lightweight API module
163
+
-**Better modularity**: Clear separation between contracts (API) and implementation (SDK)
164
+
-**Easier testing**: Components can be tested against the API contracts
165
+
-**Reduced coupling**: Implementation details are isolated in the SDK module
166
+
126
167
## 🌟 Features
127
168
128
169
| Status | Features | Description |
@@ -327,9 +368,17 @@ Additionally, you can develop a custom transaction context propagator by impleme
327
368
328
369
### Develop a provider
329
370
330
-
To develop a provider, you need to create a new project and include the OpenFeature SDK as a dependency.
371
+
To develop a provider, you need to create a new project and include the OpenFeature API as a dependency (you only need the API module for provider development).
331
372
This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/java-sdk-contrib) available under the OpenFeature organization.
332
-
You’ll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
373
+
You'll then need to write the provider by implementing the `FeatureProvider` interface exported by the OpenFeature API.
To develop a hook, you need to create a new project and include the OpenFeature SDK as a dependency.
465
+
To develop a hook, you need to create a new project and include the OpenFeature API as a dependency (you only need the API module for hook development).
417
466
This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/java-sdk-contrib) available under the OpenFeature organization.
418
467
Implement your own hook by conforming to the `Hook interface`.
0 commit comments