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

Introducing Lombok to code to reduce verbosity #50

Closed
FabiKo117 opened this issue Sep 18, 2020 · 2 comments · Fixed by #57
Closed

Introducing Lombok to code to reduce verbosity #50

FabiKo117 opened this issue Sep 18, 2020 · 2 comments · Fixed by #57
Assignees
Labels
brainstorming Idea for a potential new feature or adaption that still needs further discussion enhancement New feature or request

Comments

@FabiKo117
Copy link
Contributor

See https://www.baeldung.com/intro-to-project-lombok

Could be used in response classes to reduce the code there.

@FabiKo117 FabiKo117 added enhancement New feature or request brainstorming Idea for a potential new feature or adaption that still needs further discussion labels Sep 18, 2020
@bonaparten
Copy link
Contributor

bonaparten commented Oct 8, 2020

I have implemented Lombok in our code. You can see the changes here #57.
I used only annotations for getters, setters and constructors.

Complex Constructs cannot be handled, e.g.:
public AggregateRequestExecutor(RequestResource requestResource, HttpServletRequest servletRequest, HttpServletResponse servletResponse, boolean isDensity) { super(servletRequest, servletResponse); this.requestResource = requestResource; inputProcessor = new InputProcessor(servletRequest, true, isDensity); processingData = inputProcessor.getProcessingData(); }

It could be possible to use the builder annotations in order to build objects instead of calling constructors but IMHO this way doesn't reduce verbosity and some changes has to be done in the code itself.
It also offers other functionalities like an annotation for close() methods in finally brackets, an annotation for toString methods, etc. But they would not be really useful for us, since the use of them is really seldom in the ohsome API.

IMHO Lombok is very useful for us for getters/setters and (not complex) constructors since it really reduces verbosity.
If you like you can already merge the branch into master.
I can open a confluence page about Lombok functionalities which should be used in the ohsome API.

Lombok features
Good constructors guide

@bonaparten bonaparten linked a pull request Oct 8, 2020 that will close this issue
@FabiKo117
Copy link
Contributor Author

Nice 👍
I'll have a look at it this afternoon.

@bonaparten bonaparten self-assigned this Oct 27, 2020
FabiKo117 added a commit that referenced this issue Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming Idea for a potential new feature or adaption that still needs further discussion enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants