The Factory Method Pattern in Ruby
The Factory Method Pattern might be somewhat hard to understand at first, mainly because you probably don't need it as often. Nevertheless, it's good to know about it and use it whenever you feel it's appropriate.
👉 Buy my Bulletproof Ruby on Rails Applications eBook: j.mp/2OtFCdR
🍿 The Abstract Factory Pattern: • The Abstract Factory P...
🍿 Ruby design patterns playlist: • Design Patterns in Ruby
You can subscribe to the channel using this link: kzread.info?sub_...
Read it instead: mixandgo.com/learn/ruby/facto...
My website: mixandgo.com
en.wikipedia.org/wiki/Factory...
If you want to learn more about design patterns, check out these two books.
📖 Design Patterns: Elements of Reusable Object-Oriented Software: amzn.to/3vZ7sjp
📖 Head First Design Patterns: Building Extensible and Maintainable Object-Oriented Software 2nd Edition: amzn.to/3bvBiCF
#webdev #ruby #designpatterns #factorymethod
Пікірлер: 26
Thank you for posting these videos. Seems there arent many Ruby/Rails channels but this was just what I was looking for! Keep up the great work 👍
@mixandgo
2 жыл бұрын
You bet.
Thanks for your Amazing content. Looking forward for so many Rails video.
@mixandgo
2 жыл бұрын
You're welcome. Keep an eye on the channel. I'll post a lot more content on both Ruby and Rails.
This video is very helpful. Thank you for the great content!
@mixandgo
2 жыл бұрын
Happy to hear Harry
This is exactly what new developers need. There are already too many videos about CRUDs.
@mixandgo
Жыл бұрын
Thank you Charles. I apreciate the feedback.
Thanks for your work !!
@mixandgo
2 жыл бұрын
My pleasure.
This is very good. We need more vidoes on building patterns. Thanks for the videos
@mixandgo
Жыл бұрын
Thank you
thanks a lot !!!
@mixandgo
2 жыл бұрын
Happy to help.
You're calling an instance method(UserFactory#call) on the class which will raise an exception #=>#NoMethodError
@mixandgo
2 жыл бұрын
You are correct. Thanks pointing it out.
Nicely Explained! Line#20 should be contact method not home.
@mixandgo
Жыл бұрын
Thanks
Why call method is not declared as self? Why not just create a module called UserFactory and include it in required places?
@mixandgo
2 жыл бұрын
Hi Mahesh, good catch. It would be better if it were a class method because there is no reason for it to be an instance method. As for class vs. module, I personally prefer it to be a class because: 1) I can use the class name to indicate what it is 2) I don't want to make that responsibility part of the client class' behavior (it's a different responsibility) 3) Helps me see dependencies better when I look at the client code I hope that helps.
3:15 you should consider making your videos mobile friendly. You are using 10% of the available screen making it impossible to read on a phone.
@mixandgo
Жыл бұрын
Thanks for the suggestion.
are you hiding my comments? I would love to help add content to your site.
@mixandgo
2 жыл бұрын
no one is hiding your comments :)
@nathangwyn6098
2 жыл бұрын
I'm a self teaching junior wannabe' (ror) software developer. I noticed a few of your links were broken on your web app. Is there any chance I could help out with content?
@chalmagean
2 жыл бұрын
@@nathangwyn6098 thank you, but I don't currently accept guest posts on my blog.