java-sdk
java-sdk copied to clipboard
[TRACKING] breaking changes with API changes to consider with v2
This is a tracking issue with breaking changes such as @Deprecated annotated methods.
The resulting PR should be marked with breaking changes so that we can upgrade to the next major version (2.x)
List of tasks,
- [ ] public OpenFeatureClient : remove public access and make interna
- [ ] consider using
Numberfor numeric evaluations - [ ] rethink lombok and object creation
- [ ] Add a method to the
Hookinterface, through which the user can add hook data that can be accessed in a type safe manner during the flag evaluation:
class MyHook implements Hook<T,D>{
D getHookData(){
return myHookData;
}
void void after(HookContext<T> ctx, FlagEvaluationDetails<T> details, Map<String, Object> hints) {}
D data = ctx.getHookData(); // data == myHookData
}
}
We might also want to rethink our getters? should we maybe think already about records in the future and didge our usual getters in favor of accessors in a record kind of style?
interface EvaluationContext {
// getter style
String getFlagKey();
// record style
String flagKey();
}
as records will generate this accessor automatically for eg.
record ImmutableEvaluationContext(String flagKey)