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

Supports POJO classes with public fields without accessors (getter/setter) #1372

Open
Nick-Wunderdog opened this issue Apr 17, 2023 · 2 comments

Comments

@Nick-Wunderdog
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Spring supports POJO classes without accessors (getter/setter) with just public fields, aka. anamic classes. While anemic classes are contraversial issue, Spring and all relates other libraries do support them so for this to be compatible and follow Spring convention, so should this library support them.

Describe the solution you'd like
Support Entity class annotated public fields without accessor methods. Like Spring Data (REST) does.

Describe alternatives you've considered
Document clearly that anemic classes are not supported with this library.

Additional context
Anemic classes are contraversial but there is school of though that they are ok in Entity classes as those should NOT contain any business logic. So them being anamic and immutable would be ideal. Unfortunately it is difficult or even impossible to make them immutable (to make fields public final) so all of the solutions are helf measures. And since there is no clear universal convention on this, it would be nice to support commonly accepted best practices. Even if their schools of though are at war each others. Some - like myself - think that anemic entity classes are smaller antipatterns than contaminating whole project with Lombok.

@paulcwarren
Copy link
Owner

This is a bit of a controversial topic and this is the first time anyone has raised it, I think. So, most users probably aren't following this pattern. That said I can look into what it would take to support. If it is not that much then I'd be fine adding it to bring closer to official Spring projects.

Be great to see some upvotes too though.

@Nick-Wunderdog
Copy link
Contributor Author

Like I said the fuctionality itself is bit of contraversial. Main reason this should be supported is to be in-line with Spring, as they suport this. But this is not high priority feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants