Тёмный

You DON'T NEED LOMBOK | What is Lombok? | Why I don't use it | Java Tutorial 

Programming with Mati
Подписаться 3 тыс.
Просмотров 1,1 тыс.
50% 1

Опубликовано:

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@edwarddemesaify
@edwarddemesaify 7 дней назад
Excellent explanation of Lombok and why using Records may be a better alternative. Thank you...
@vinitsawant9081
@vinitsawant9081 7 месяцев назад
If one needs immutability they should use records... For all other cases where the fields can be modified one can opt for lombok.
@ronySky_
@ronySky_ Год назад
Hi Mati, thanks for the follow-up video. I didn't know how Lombok does the preprocessing, and I consider that to be the strongest argument here. All that thing about code transparency and 3rd party libraries don't really hold water, because almost every project out there depends on some library that might stop working some day. I still hold that switching to records we lose one of the biggest advantages of Lombok: @Builder. This might seem irrelevant when your classes have 2 or 3 fields, but when this number grows, you'll want builders.
@programmingwithmati
@programmingwithmati Год назад
Hi! Thanks for the comment! I think that Lombok still has really good uses and I would use it in some conditions. But for the most part I try to avoid it. Thanks for sharing your thoughts!!
@Ligtez
@Ligtez 11 месяцев назад
Now is possible to use @Builder in a Record.
@Esteban-ck2qc
@Esteban-ck2qc Год назад
No creo poder utilizarlo como reemplazo a un DTO debido a que como manejamos los campos opcionales ? Supongamo que una API me devuelve 10 parámetros. Yo puedo hacer tranquilamente un DTO con esos 10 parámetros y luego si alguno no está presente no se definirá (en conjunto con jackson), pero con los Records (que tienen por defecto campos finales) cómo haríamos ? Si solo vienen 4 de 10 parámetros en mi Record.
@programmingwithmati
@programmingwithmati Год назад
Los valores de los campos en records pueden ser null.
@aritrobiswas1731
@aritrobiswas1731 Год назад
I don't understand one thing. I know that we use getters and setters for controlled access, we can put custome checks inside the functions. But using Lombok defeats the purpose because there is only one validation annotation like @NonNull. We will have to write the custome methods anyways.
@programmingwithmati
@programmingwithmati Год назад
To be completely honest, since I’ve been doing a lot more functional programming, I don’t really care for accessor methods. I’d rather be able to access all of the properties directly. What you say makes sense. Having controlled access to properties makes the usage of Lombok unnecessary. Thanks for commenting and sharing your thoughts.
@Esteban-ck2qc
@Esteban-ck2qc Год назад
Hi! Can you explain the "turn checked exceptions into uncheked exceptions" and give and example ? Thanks
@programmingwithmati
@programmingwithmati Год назад
Hi. Basically, if you annotate the method that throws a checked exception with the annotation @SneakyThrows, it will turn the checked exception into an unchecked exception
@maxmuster7003
@maxmuster7003 Год назад
I don’t need java.
Далее
Object-Oriented Programming is Bad
44:35
Просмотров 2,3 млн
What's So Special About this Python Framework?!
6:56
JAVA DTO Pattern Tutorial | Simplify Your Code
19:12
Просмотров 202 тыс.