Resisting complexity
summary
Argues methods are affordances not abilities and shows concrete refactors: move broadcast into Announcement so the Announcement.broadcast method moved, replace PurchaseFulfillmentService by moving fulfill into Purchase and using an event listener, introduce a real Checkout object to encapsulate payment and creation, prefer either facades/service-location or threading the queue dispatcher and mailer for dependencies, and replace a license generator class with a container-resolved generate_license_code invokable so tests can stub it; result is fewer agent-noun classes and simpler, more encapsulated Laravel Eloquent code with working queues, mail, and events.
AI-written summary · about
chapters (15)
- 0:00Intro
- 0:33Resisting COMPLEXITY with Adam Wathan
- 3:56A GARDENER CAN WATER A PLANT.
- 4:16AN ARRAY CAN REVERSE
- 4:31A STRING CAN SPLIT A DELIMITER.
- 5:00A OBJECT CAN BE METHOD ( USING A {PARAMETER}.)
- 5:13METHODS ARE Affordances
- 6:22A STRING CAN BE SPLIT USING A DELIMITER.
- 7:20A GARDENER CAN BE WATERED USING A PLANT.
- 8:36Eliminating AGENT NOUNS
- 13:41CONQUERING YOUR Fear of Facades
- 15:55Ergonomics MATTER
- 20:54PUSH SIDE WORK TO Event Listeners
- 31:49Maybe you just need a FUNCTION
- 37:27Agent nouns are a LAST RESORT
related talks
25mRefactoring: The ASMR of Programming Talks
41mConcerns, Decorators, Presenters, Service Objects, Helpers, Help Me Decide!
35mCode Refactoring Workshop
36mIn Relentless Pursuit of REST
44mRefactoring from Good to Great
39mExploring Rails anti-patterns
38mLaravel Design Patterns
54mGet better at Refactoring
