Quarkus Panache Active Record vs. Repository Pattern

Quarkus Panache Active Record vs. Repository Pattern

Sebastian Daschner

1 год назад

5,165 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Frank Underwood
Frank Underwood - 26.06.2023 23:35

Thank you, Sebastian!
Very inspiring and valuable tutorial.

Would like to suggest you making something with EventBus / Reactive Messaging with Quarkus with SSE (Server-Sent Events) usage. In my opinion, really interesting topic, but there are not enough guides with this stuff. Thanks again!

Ответить
Juan Antonio Jiménez Torres
Juan Antonio Jiménez Torres - 13.06.2023 21:21

I prefer Active Record way, But this is a static way. In the TDD you must use a "panache mock". But this way I think is more clear. repository way is another "a long time ago" layer.

Ответить
Vemai Esli
Vemai Esli - 31.05.2023 20:22

It seems to me like using Active record pattern breaks Single Responsibilty Pattern because we're having both database responsibility and entity responsibility in a single Entity class. Or am I missing something here?

Ответить
wenijinew
wenijinew - 25.05.2023 20:47

Hi Sebastian,
Thanks for the video. Could you please share which applications do you use to record and edit the video?

Ответить
Zrubi Z
Zrubi Z - 24.05.2023 13:23

Thanks for the video. I use the active record pattern because to me it make much more sense then the repository pattern and there is also 1 more benefit to the active record that you didnt mention: If you need to use multiple entities in one place you won't need to inject each and every one of them, just use the object as is which less code that is more orginzed.

Ответить
Richard Titze
Richard Titze - 24.05.2023 10:20

One thing that always bothered me is that for example "var coffee = Coffee.findById(id);" would not really work - you'd have to use "var coffee = Coffee.<Coffee>findById(id);" to get the correct type for your coffee variable.

Ответить
Daniel Wamara
Daniel Wamara - 24.05.2023 03:06

I always use the Active Record pattern because using the Repository pattern will mean for me 2xn classes if I have n entities and I always go for as less classes as I can.

Ответить
Bruno Masetto Sander
Bruno Masetto Sander - 24.05.2023 00:33

Awesome video!!! Is there a way to use records instead of classes in the panache active approach?

Ответить
Omar Zahid
Omar Zahid - 23.05.2023 23:30

I use Active Record pattern. If I'm not mistaken this approach is preferable by the Quarkus team over the repository pattern but your argument makes me want to migrate over to the repository.

Ответить