Design Patterns on the Frontend and You
Hello Ruby friends!
March seemed to run away from me, but I'm back on the scene and letting you know about not one, but two new resources published on Fullstack Ruby! Before we get into that however, I'd like to mention I'll be attending RailsConf 2022 in Portland, Oregon next month. If you plan on being there as well, I'd love to meet up with you! (email me to let me know!)
Now on with the news:
Podcast Episode 4: Design Patterns on the Frontend, History of MVVM, Web Components, and You
Design patterns on the frontend: this is a subject far too little discussed from what I can tell, yet with a fundamental awareness and regular usage of design patterns, you can dramatically uplevel your frontend code. Rubyists in particular will have a major leg up here over devs coming from communities which are more FP (functional programming) in nature, because the view layer of the web is inherently object-oriented.
Ready for a deep dive into the history of object-oriented views (predating the web!) and how we got to the modern web components world of today? Listen to the show!
Article: Transform Your Data Object-Oriented Style with Formatters
I admit it. I’m a design pattern nerd. I’ve been a massive fan of object-oriented design patterns ever since I read Patterns of Enterprise Application Architecture in the mid-2000s. One of the aspects which first drew me to Ruby, via Rails, was the in-depth adoption of so many of these patterns and how easy it is to write elegant Ruby code using OOP (Object-Oriented Programming) design patterns.
In this article, I talk about a variant of the Template Method design pattern I’ve used in a number of scenarios. I don’t know of a formal name for this pattern, so I like to call it the Formatter pattern. By executing a sequence of formatters, you achieve a process which I think of as a data pipeline. The data pipeline itself can also be represented as an object.
I truly adore this design pattern. Once you know it, you start to see its usefulness across a wide variety of scenarios, codebases, and even programming languages.
Read the Rest of the Article ▸
A little milestone to celebrate before you head off: the Fullstack Ruby podcast has passed 800 downloads! By the next episode I'm hoping it'll reach 1000+. This may not seem like a lot to some of you, but it's by far the most successful show I've ever done, so I just want to say thank you to the Ruby community. Y'all are amazing. 🙏