Overview
Save Big on Coursera Plus. 7,000+ courses at $160 off. Limited Time Only!
Explore the intricacies of implementing service objects in Ruby on Rails through this informative conference talk. Delve into the concept of service objects and their role in managing custom business logic beyond Rails' standard functionality. Learn about various approaches to structuring service objects, including object-oriented and functional programming patterns. Discover techniques for error handling, code reuse, and directory organization. Compare different methods for managing step failures, such as nested conditionals, raising exceptions, and using return values. Gain insights into the pros and cons of different implementation strategies, enabling you to make informed decisions when incorporating service objects into your Rails projects.
Syllabus
Introduction
Service Objects
Rails
What are Service Objects
Object Oriented Patterns vs Functional Patterns
Functional Programming in Ruby
LightService
Handling Errors
Nested Conditionals
Dont do this
Raising exceptions
Throwing errors
Return values
True false
Openstructs
Custom Classes
Where to put the code
Outro
Taught by
Ruby Central