You know that Domain Driven Design, Hexagonal Architecture, and the Single Responsibility Principle are important but it’s hard to know how to best apply them to Rails applications. Following the path of least-resistance will get you in trouble. In this session you will learn a way out of the “fat model, skinny controller” hell. You will leave with a roadmap to guide your design based on concepts from Domain Driven Design and Hexagonal Architecture.
31. class OrdersController < ApiController
!
def create
order = request_object.to_order
transaction = OrderService.new.create(order)
!
if transaction.success?
order_created(order)
else
payment_failed(transaction)
end
end
!
end
44. Reading
Patterns of Enterprise Application Architecture
Martin Fowler
Domain Driven Design
Tackling Complexity in the Heart of Software
Eric Evans
Practical Object Oriented Design in Ruby
An Agile Primer
Sandi Metz
45. Reading
Clean Code
A Handbook of Agile Software Craftsmanship
Robert C. Martin
Implementing Domain Driven Design
Vaughn Vern