The Bare Minimum Intro To Service Object & POROs | Ruby On Rails Tutorial

  Рет қаралды 4,437

Deanin

Deanin

Жыл бұрын

Ya'll take this stuff too seriously. Service objects and Plain Old Ruby Objects (POROs) are just some Ruby classes that do some business logic.
Checkout my course(s) at: learn.deanin.com
Join this channel to help support these videos:
/ @deanin
Follow me on social media:
linktr.ee/deanin
If you liked this video, please consider subscribing: t.co/RZ4EwP0F2a
#Deanin #Software #Programming

Пікірлер: 16
@Deanin
@Deanin Жыл бұрын
If you want more than the bare minimum, consider reading this now that you know how to make a service object: www.toptal.com/ruby-on-rails/rails-service-objects-tutorial
@Deanout
@Deanout Жыл бұрын
But Dean, what about what I wanted you to talk about? The cool way to not need to use the new command, or why service objects should only have one public method because I said so? Or or or-
@Deanin
@Deanin Жыл бұрын
Read the link.
@developerfoe
@developerfoe Жыл бұрын
coming for next video ...
@johanandre5338
@johanandre5338 Жыл бұрын
I use service objects when the logic does not clearly belong in a specific place (usually a model). Like doing a operation which requires two or more different instances. That logic can sometimes be misplaced in a model. But as you say, it’s only plain ruby classes… ☺️
@aarona3144
@aarona3144 Жыл бұрын
The amount of shade you're throwing at everyone in this video is hilarious (including that streaming site) 😆. You're right though, a lot of this stuff shouldn't be taken too seriously but I think its a good idea to see what tends to be about one or two best practices like how you're doing here.
@mertgunduz5571
@mertgunduz5571 Жыл бұрын
Great outro speech Dean 👍
@ellerium
@ellerium Жыл бұрын
Hey, I'm new to your channel, and I need to say I really liked your videos. I've been working with Rails for some time. And really appreciated your way of talking about this concept of service objects. Especially for keeping away all the passionate discussions. I have an honest curiosity I'd like to ask: Did already thought about those service objects as a model? As in the Model-View-Controller design. I'm asking because I understand an ActiveRecord object as a model of a Business Entity. While the service is a model of a Business Process. Does it make sense? Thanks for you videos!
@iamshairyar
@iamshairyar Жыл бұрын
Quick refreshment course
@azizdevfull
@azizdevfull Жыл бұрын
very very useful for me bro : )
@MrThomas8307
@MrThomas8307 Жыл бұрын
Hi Deanin. Thanks for your useful video. Now maybe you show us how to use "dry-monads" .
@ledockol
@ledockol Жыл бұрын
Thanks! 👍 Rails 7 Search Facets Filters?
@OjasMutreja
@OjasMutreja Жыл бұрын
Hey there, I am unable to the right extensions of VS Code for Ruby on Rails7, could you please guide me
@merlin2049er
@merlin2049er Жыл бұрын
Put it in the tmp folder
@freibuis
@freibuis Жыл бұрын
not a fan of service objects my self but I would use ThingService.call(object) instead of ThingService.new(object).call the reason why I think the use of call instead of using the method name same as the class name example ThingService.new(object).do_thing is that the class name tells you what its doing. you dont need to tell me twice. nothing wrong with it but my ocd kicks in. I prefer to use model concerns to clean up models.. but some times you might want to pass options and this will break when using model concerns. this is when I would use a service object. lets say 1 model has a counter column called countera and another counterb .. you could do something like IncrementService.call(object, :countera) .. then logic to increment that coloum... This would remove duplicating logic accross models. I personally dont use them. but if a project that I join is using them. I would continue the convention.
@vinogradova82
@vinogradova82 Жыл бұрын
Cool!) If use this like below, then no need to call a new method in controller. Only use inheritance in all yours services. Right?) # app/services/application_service.rb class ApplicationService def self.call(*args, &block) new(*args, &block).call end end
The Ruby On Rails Junior Developer Problem
16:03
Deanin
Рет қаралды 18 М.
Missing Guide to Service Objects in Rails - Riaz Virani
30:56
Ruby Central
Рет қаралды 7 М.
Just try to use a cool gadget 😍
00:33
123 GO! SHORTS
Рет қаралды 73 МЛН
Khóa ly biệt
01:00
Đào Nguyễn Ánh - Hữu Hưng
Рет қаралды 11 МЛН
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 77 МЛН
Taking A Look At Scopes In Ruby On Rails 7
11:16
Deanin
Рет қаралды 2,1 М.
Working with ActiveRecord Serializers to customise API response
13:54
APPSIMPACT Academy
Рет қаралды 151
Is ViewComponent the Future of Rails?
12:25
Mix & Go
Рет қаралды 7 М.
Get Requests In Ruby On Rails 7 With HTTParty Gem
15:04
Deanin
Рет қаралды 4,2 М.
Build a Chat App with Ruby on Rails and Ollama
27:22
Phil Smy
Рет қаралды 1,4 М.
Turbo Frame Modals (Popups) | Ruby On Rails 7 Tutorial
12:49
Modules vs Concerns
12:43
TypeFast
Рет қаралды 3,9 М.
Just try to use a cool gadget 😍
00:33
123 GO! SHORTS
Рет қаралды 73 МЛН