Skip to content
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

refactor: AbstractTrackerPersister should be more readable now [TECH-775] #9091

Merged
merged 15 commits into from
Oct 21, 2021

Conversation

gnespolino
Copy link
Contributor

as mentioned in #9069 the handle method looked too complex, so I tried to split it up and simplify it as much as possible.
Please besides reviewing the solution, also take some minutes to verify no major issues have been introduced.

Copy link
Contributor

@zubaira zubaira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@lucaCambi77 lucaCambi77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me, however, I'd prefer not to use nested classes and extract them in a separate package with that visibility

Copy link
Contributor

@enricocolasante enricocolasante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion the code is not more readable, it is more compact and maybe hidden in a better way in a inner class but it is difficult to follow the flow of the code and understanding what is happening

@gnespolino
Copy link
Contributor Author

It looks good to me, however, I'd prefer not to use nested classes and extract them in a separate package with that visibility

CTX class is now in a separate file

Copy link
Contributor

@teleivo teleivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnespolino thank you for taking the time to dig into making this class more readable 😄

I have to side with @enricocolasante that I do not think adding the TrackedEntityAttributeValueContext class helps in readability. I do think the changes you made to the AbstractPersiter are more readable though. So the flow in general and how you reduced nesting 😁 I believe it should be possible to move the code in TrackedEntityAttributeValueContext back into the AbstractPersister as private methods. Some of the methods as I commented, can also be inlined IMHO. We would still get the benefit of less nesting/more readable code without an extra abstraction.

@gnespolino gnespolino requested a review from teleivo October 20, 2021 17:01
Copy link
Contributor

@teleivo teleivo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like we discussed on the call I leave it up to you if you go with this version or the "inline" version without the Context class 😄

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@gnespolino gnespolino merged commit 78b24b2 into master Oct 21, 2021
@gnespolino gnespolino deleted the TECH-775-refactor-abstract_persister branch October 21, 2021 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-api-tests This label will trigger an api-test job for the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants