Skip to content

Consider using Lombok #3

Description

@benmccann

I noticed you have all public variables in one of the first classes I opened:
https://github.com/ivannp/tradelib/blob/master/src/main/java/net/tradelib/core/TradeSummary.java#L17

This is pretty uncommon for Java. Typically you'd make these private and use getters and setters. The reason for this which is that if you want to change the logic (e.g. add validation in a setter or make a getter return a computed value) is that it doesn't require much refactoring if you're using getters and setters.

Of course writing and maintaining these getters and setters is an ugly pain, but there's a great solution for this with Lombok: https://projectlombok.org/features/Data.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions