Missing Guide to Service Objects in Rails - Riaz Virani

  Рет қаралды 7,512

Ruby Central

Ruby Central

Күн бұрын

Пікірлер: 14
@rockatanescu
@rockatanescu 2 жыл бұрын
I've used service objects multiple times and I've always felt like something was off. After reading about DDD I think I finally understood what I don't like about them: service objects allow a high degree of complexity and most of the times you do not need or want that much complexity because it makes testing and refactoring a lot harder. One clear sign of the underlying complexity is the need to talk about control flow and how using the Ruby version of the GOTO instruction is a "preferred approach". As an experiment, I've tried understanding a bit better the behavior and how the objects interact and I've noticed that almost always a plain Ruby object was more than enough. Of course, service objects have their uses and it's an excellent idea to talk about them. However, I've seen many times people reach for service objects first, allowing a lot of complexity to creep in.
@darkamenosa03
@darkamenosa03 2 жыл бұрын
The very hard to read at 21:22 is actually the easiest to read. We dont need to spend time to understand the pattern and anyone can understand. Pattern was born to solve problem, not to create problem. Adding a new dependency (gem) just to achieve a little beautiful code is not what I want to do. Since no one know what would happen tmr for that dependency. I trained my whole team from OOP to FP(functional programming), and switched to write code like that. It ends up a mess. When new member entered the project, they had hard time just to grab the concept. The first service object pattern is more elegant than the second, since many developers are more familiar with OOP, and you dont have to add extra dependency to the project.
@hackur
@hackur 3 жыл бұрын
Extremely informative. Exactly what I came for. I'm glad he covered all the different approaches w/ pros and cons.
@BillyYarosh
@BillyYarosh 2 жыл бұрын
I’m glad others are thinking about service objects. Most other language frameworks use service classes that contain all CRUD actions. I find it interesting that ruby folks still think of services in the context of a single action. So OrderService instead of OrderCreator.
@ricardororiz1728
@ricardororiz1728 2 жыл бұрын
Thank you so much! This is a problem that a tackled with so many different solutions - and this video kind says "It's Ok, a lot of people have this problem and these are some solutions"
@vendetta3953
@vendetta3953 3 жыл бұрын
masterpiece! Talked about almost every nuance one might face! Thanks very much
@haroldpepete
@haroldpepete 2 жыл бұрын
great guide, thanks, you have a new subscriber
@AndyKoch
@AndyKoch 3 жыл бұрын
Really excellent presentation!
@benjaminmoseslieb9856
@benjaminmoseslieb9856 2 жыл бұрын
Great talk. Good description of the problem domain and various ways to approach dealing with it. Was interested in the "functional" approach, but (and this is probably because I don't do a lot of functional programming) I couldn't tell what was specifically functional about it (I was thinking mutability etc). Will look at lighthouse. Wonder if there are any other gems for service objects that are basically POROs, where you don't have to invent the return classes yourself etc.
@edimossilva
@edimossilva 2 жыл бұрын
Amazing talk!
@EnjoytheMents
@EnjoytheMents 3 жыл бұрын
Great video. Really helpfull!
@Igoryan481
@Igoryan481 3 жыл бұрын
Thank you!
@prakashsanyasi5608
@prakashsanyasi5608 3 жыл бұрын
I loved it 🥰
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
A Deep Dive into the Ruby Object Model
34:01
Peter Cooper
Рет қаралды 47 М.
Keynote: Eileen Uchitelle - All the Things I Thought I Couldn't Do
1:09:14
Чем dry-rb (не) полезен мне
17:25
Ruby Russia club
Рет қаралды 1,6 М.
RailsConf 2019 - Cache is King by Molly Struve
35:53
Confreaks
Рет қаралды 9 М.
Realtime Apps with Hotwire & ActionMailbox - Chris Oliver
43:47
Ruby Central
Рет қаралды 4,3 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН