-
Notifications
You must be signed in to change notification settings - Fork 74
feat(java,info): add vertex info builder #764
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
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #764 +/- ##
============================================
+ Coverage 75.77% 75.83% +0.05%
- Complexity 470 472 +2
============================================
Files 82 82
Lines 8550 8577 +27
Branches 964 966 +2
============================================
+ Hits 6479 6504 +25
- Misses 1873 1875 +2
Partials 198 198
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi @Jarvx200 , pls add more test case |
maven-projects/info/src/main/java/org/apache/graphar/info/VertexInfo.java
Outdated
Show resolved
Hide resolved
Hey there, I've looked at the builders and there seem to be some recurring attributes that need to have specific methods and transient fields (eg. |
Hi @Jarvx200 , that's an excellent suggestion. Creating an abstract super-class for the builders is a great approach to handle recurring attributes (like PropertyGroups, baseUri and etc.) and keep the code concise by avoiding redundancy. Please feel free to proceed with that implementation. It's a solid design choice. |
Sure thing, I will adhere to this design choice and continue working, thanks for the feedback! |
Hey there, I this is a rough sketch of the proposed abstract builder, I will have to solve the conflicts locally first and find a way to organize the files in such a way that the access modifiers remain to minimum. Breaking: Moved |
# Conflicts: # maven-projects/info/src/main/java/org/apache/graphar/info/PropertyGroup.java # maven-projects/info/src/main/java/org/apache/graphar/info/VertexInfo.java # maven-projects/info/src/test/java/org/apache/graphar/info/VertexInfoTest.java
Looking on the errors it seems like the tests fail because I extracted If it's ok, I think extracting the AbstractBuilder from it's package and placing it with the other classes which require it. It will help with this but also will help by limiting the access modifiers in it's internal api. |
Hi @Jarvx200 , I think some simplicity can be wasted in order to keep it easy to read. We can add a builder method in
in both |
Hey there, thanks a lot for the feedback. Looking back it seems a bit too complicated and it might be harder to mentain. I will try to find a middleground so I respect DRY principles but don't overcomplicate the codebase. Maybe embedding a small builder as an instance variable for common fields could be a bit of a better idea? |
@Jarvx200 ,We can implement it in a simple way, and then improve it later. What do you think? |
For sure, I will do it like you proposed at first so it's working and then we can work on reducing redundancy! |
Reason for this PR
Refactor for
VertexInfo
telescoping constructor ( #740 )What changes are included in this PR?
Added a simple builder for the class with basic testing
Are these changes tested?
yes
Are there any user-facing changes?
no