question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deprecate Immutables in favor of Lombok

See original GitHub issue

We seem to have settled on Lombok as the preferred solution for convenient creation of immutable classes in Java Lagom applications.

There’s a bit of clean up we can do to clarify this:

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:7
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
jropercommented, Apr 10, 2017

It’s a bit of a shame really. I’m just glad I can use Scala and not have to deal with issues like this in Java. People complain about a lot of things in Scala, but I have never once heard Scala developers complain about Scala preferring and strongly encouraging the use of Option in place of null, that’s always something that is put in the advantages column. Option tends to be one of the first things people who switch from Java to Scala fall in love with, so the author of Lombok I think is standing all by himself with that opinion there, possibly from a position of ignorance, though I don’t know if he’s ever used Scala in anger or not.

We don’t force anyone to use Optional in their data objects, though our APIs, as much as possible, never return null. We leave it up to the end user to decide what they want to use. If Optional is important to you, then perhaps it may make sense to use Immutables. The reason we moved away from Immutables is that getting it working nicely in an IDE ended up being far too painful, it was a huge roadblock to a smooth getting started experience in Lagom. So it seems to be a choose your poison situation, with the ideal experience being to switch to Scala.

1reaction
TimMoorecommented, Mar 21, 2017

I think it could totally be done in a series of smaller PRs. I updated the list above to be a checklist so that we can track as each part is completed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Records Are Here! Can We Remove Lombok Already? - Medium
So, if you only use Lombok for small, immutable objects — yes, you can remove it. Though, this is probably not the case....
Read more >
Immutable objects
An immutable implementation class implements abstract attribute accessors for scalar primitive and object reference types, with special support provided for ...
Read more >
Lombok, AutoValue, and Immutables - DZone
Lombok, AutoValue, and Immutables each support generation of "value objects." While AutoValue strictly enforces generation of value objects, ...
Read more >
support creating circular references for immutable objects #1623
About incompletePublishing = true being a misnomer, I somewhat agree. Its purpose is to tell lombok that the this reference should leak out...
Read more >
Kotlin Makes Lombok Obsolete - Level Up Coding
To update fields in immutable classes, you clone the class with a new value for the field you want to change. Lombok provides...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found