-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: BSON
Use Case
As a BSON user
I want static builders (Binary.createFromBase64, Timestamp.fromBits, etc.) to use the current constructor, "this"
So that my subclasses are built by these methods.
User Experience
- What is the desired/expected outcome for the user once this ticket is implemented?
- (class SuperLong extends Long {}).fromString("2") returns SuperLong
Dependencies
- None
Risks/Unknowns
- What could go wrong while implementing this change? (e.g., performance, inadvertent behavioral changes in adjacent functionality, existing tech debt, etc)
- N/A. Feature.
- Is there an opportunity for better cross-driver alignment or testing in this area?
- No
- Is there an opportunity to improve existing documentation on this subject?
- API docs can mention this
Acceptance Criteria
Implementation Requirements
- Audit all static builder functions for hardcoded use of their constructor and change them to use "this" instead.
- In a static method "this" is the current class
Testing Requirements
- Regression testing
Documentation Requirements
- API docs
Follow Up Requirements
- Could this be a lint rule?