You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-2
Original file line number
Diff line number
Diff line change
@@ -410,35 +410,42 @@ end
410
410
Yes I agree. It's early days and I'm open to syntax improvement ideas. This is really about it being conceptually less ugly than the alternative, which is to jump around between lots of files. In the existing alternative to using this gem the ugliness is not within each individual file, but within the overall hidden architecture and the hunting process of jumping around in complex interactor chains. We can't see that ugliness but we probably experience it. If you don't feel or experience that ugliness then this gem may not be the right fit for you.
411
411
412
412
413
-
- Is this interactor/interactor-contracts compatible?
413
+
- Is this interactor/interactor-contracts compatible?
414
+
-
414
415
Yes and we use them as dependencies. It's possible we'd drop those dependencies in the future but unlikely. I think it's highly likely we'd retain compatibility.
415
416
416
417
417
418
- Why not propose changes to the interactor or interactor-contracts gem?
419
+
418
420
Honestly, I think both are great and why we've built on top of them.
419
421
I presume they'd object to such an extensive opinionated change, and I think that would be the right decision too.
420
422
If this becomes more stable, less coupled to Rails, there's interest, and things we can provide upstream I'd be happy to propose changes to those gems.
421
423
422
424
- Isn't this all just syntactic sugar?
425
+
423
426
Yes, but it's sugar that makes the code easier to read and understand.
424
427
425
428
- Is it really easier to parse this new DSL/syntax than POROs?
429
+
426
430
That's subjective, but I think so. The benefit is you have fewer extraneous files patching over a common problem in interactors.
427
431
428
432
- But it gets really verbose and complex!
433
+
429
434
Again this is subjective, but if you've worked with apps with hundred or thousands of interactors, you'll have encountered these problems.
430
435
I think when we work with interactors we're in one of two modes.
431
436
Hunting to find the interactor we need to change, or working on the interactor we need to change.
432
437
This makes the first step much easier.
433
438
The second step has always been a great experience with interactors.
434
439
435
-
- I prefer Service Objects
440
+
- I prefer Service Object
441
+
436
442
If you're not heavily invested into interactors this may not be for you.
437
443
I love the chaining interactors provide.
438
444
I love the contracts.
439
445
I love the simplicity of the interface.
440
446
I love the way they can be composed.
441
447
I love the way they can be tested.
448
+
442
449
When I've used service objects, I've found them to be more complex to test and compose.
443
450
I can't see a clean way that using service objects to compose interactors could work well without losing some of the aforementioned benefits.
0 commit comments