-
Couldn't load subscription status.
- Fork 1
feat: idea for api design #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@ThomasVitale @lordofthejars take a look and let me know what you think of this approach. I didn't get into ServiceLoaders or anything like that. I think that overcomplicates things. |
145e42f to
14aae2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow almost everything is done hahaha we are almost ready to go. Looks good to me just one small comment.
Well, not really :) This is just a design idea that I've only implemented for one of the model objects to show the idea/pattern. If we want to adopt this pattern then we need to implement it across the board. Then we need documentation, release automation, etc :) |
Perfect, looks good to me, then we erge this one and we adapt the rest of the model, or we push ito this PR? |
If we like this model then I'll fill in this PR with the rest of the API (its currently marked as draft). I'd like Thomas to weigh in first though, since he was the one who built the initial version. |
|
Thanks for this PR! In general, I like the approach, but I have two concerns:
|
Agreed. And I realized that doing this required "leaking" That being said, could that be an implementation detail? Since they are annotations, could we support both jackson databind 2.x & 3.x? But then that would violate #23 (comment). We definitely need to support both 2.x & 3.x, AND I think backwards-compatibility & immutability is super important.
I agree with what you've said. In a perfect world I'd like to have everything, so maybe we need to prioritize our list of requirements? We all know that software engineering is mostly about understanding that there isn't a "perfect" solution to anything - its about knowing & evaluating trade-offs. I think we need to prioritize our requirements by importance. I've taken a stab at what I think. Maybe the best solution here is to go back to simple Java Pojos for the model classes and stop trying to be "cute" about it? The code isn't as clean and it allows for mutability, but it also allows for the most customization/generalization? |
|
Maybe we can start with POJOs and if we see taht the project got a high level of adoption, that lot of different Java frameworks are adopting and so on, then we can always refactor. |
24a7767 to
6029285
Compare
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
Support both Jackson 2 & Jackson 3 Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
Support both Jackson 2 & Jackson 3 Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
|
@ThomasVitale @lordofthejars I've found a way to support both Jackson 2 & 3 in the API & client Since they are annotations, I can have both Jackson 2 & 3 at the API level. Then at the client level I can support both 2 & 3 through a Factory interface, which can detect which client to give based on whats on the classpath. |
Support both Jackson 2 & Jackson 3 Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
Support both Jackson 2 & Jackson 3 Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
An idea for api design. This still allows using Java records to implement the model objects, but also makes these objects backwards-compatible by introducing interfaces & builders.
NOTE I've only applied the pattern to the
DocumentResponseso that we can decide if this is a good approach or not. If so, we can apply this pattern to the others.FIxes #23