RubyConf 2021 - Service Objects With Dry.rb: Monads and Transactions by Paul Sadauskas

  Рет қаралды 6,706

Ruby Central

Ruby Central

2 жыл бұрын

Service Objects With Dry.rb: Monads and Transactions by Paul Sadauskas
Service objects are an important tool in your toolbox, and Dry.rb's Transaction library is one of the most powerful, and one of the most magic. It's a "business transaction" DSL, and has error handling as a primary concern. We'll start by exploring Monads in Ruby (they're not scary!). Then we'll see how that simple concept unlocks another level of service objects that are far more robust and testable, and how to wire them all together with Dry::Transaction. Finally we'll touch on extending transactions with custom steps, and how to integrate them into an existing application.

Пікірлер: 11
2 жыл бұрын
This is pretty impressive and the result is "chef's kiss"
@whyimustusemyrealname3801
@whyimustusemyrealname3801 Жыл бұрын
watching this makes me kinda regret not focusing on phoenix and elixir lol
@aislanarislou
@aislanarislou Жыл бұрын
Haha there things like this are much more simpler :)
@dgmstuart
@dgmstuart 3 ай бұрын
This pattern shown at the beginning (pass config and collaborators to the initialiser, pass data to the call method) is exactly how I personally like to create service objects: it’s great and makes for straightforward testing and dependency injection. But it’s not the command pattern, as I understand it? My understanding of the command pattern is that it’s for a very specialised use case where you build an object with everything, including the data, and then execute it (with no arguments) later. The canonical example I’ve seen is of a text editor, where individual commands are created into an undo stack. But maybe there are competing definitions? Does anyone have a link describing the version of the command pattern described in this talk?
@KamaluddinPanhwar
@KamaluddinPanhwar Жыл бұрын
Very nice talk first part is good about Command patterns and they should be used, but later it deviate a lot from coding and different is way much to be used in normal environment. Also step adapter is good but it still deviate a lot from ruby coding.
@jeysonanibalpalaciopalma5986
@jeysonanibalpalaciopalma5986 Жыл бұрын
How is it working with multiple steps if each step is writing something into DB, it have something like ActiveRecord::Transaction? if some step fails it is not committing changes to db?
@0xc0ffee_
@0xc0ffee_ Жыл бұрын
Thank you! On my way to increase my salary!
@julian_handpan
@julian_handpan 2 жыл бұрын
I don’t like this lib! It’s just complicating things that we already have in the core language and complicate things more…
@dablurr3401
@dablurr3401 2 жыл бұрын
High level programming might not be understood by all that's for sure. Been using it at the highest level for three years now, let me tell you there is nothing clearer than this lib, and the paradigm dry introduces is probably the best one out there. Good luck to you.
@viktorshinkevich3169
@viktorshinkevich3169 Жыл бұрын
it just takes some time to get used to idea of functional programming, it helps a lot once you on with the idea.
@TheKuhtaMusic
@TheKuhtaMusic 4 ай бұрын
As much as I feel like this will take a while to fully understand, it sounds like it might br worth it.
The delivery rescued them
00:52
Mamasoboliha
Рет қаралды 10 МЛН
100❤️
00:20
Nonomen ノノメン
Рет қаралды 66 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 100 МЛН
100😭🎉 #thankyou
00:28
はじめしゃちょー(hajime)
Рет қаралды 58 МЛН
RubyConf 2019 - The Functional Rubyist by Joe Leo
34:39
Confreaks
Рет қаралды 6 М.
Frontendless Rails frontend - Vladimir Dementyev
34:35
Ruby Central
Рет қаралды 10 М.
Tom Stuart - Refactoring Ruby with Monads
30:05
Codegram
Рет қаралды 13 М.
dry-rb, collection of next-generation Ruby libraries
1:05:18
GitHub
Рет қаралды 2,8 М.
Hotwire Demystified - Jamie Gaskins
34:18
Ruby Central
Рет қаралды 11 М.
Implicit to Explicit: Decoding Ruby's Magical Syntax - Justin Gordon
37:20
All you need is Rails (Engines): Compartmentalising your Monolith
38:26
The Ruby Object Model by Dave Thomas
1:03:32
Szymon Madeja
Рет қаралды 20 М.
iPhone 15 Pro vs Samsung s24🤣 #shorts
0:10
Tech Tonics
Рет қаралды 13 МЛН
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 4,8 МЛН
Bluetooth Desert Eagle
0:27
ts blur
Рет қаралды 6 МЛН
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,5 МЛН
Где раздвижные смартфоны ?
0:49
Не шарю!
Рет қаралды 807 М.