A podcast about web design and development.
…
continue reading
Content provided by Adam Wathan. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Adam Wathan or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!
Go offline with the Player FM app!
34: Matt Machuga - Dealing with Dependencies in Active Record Models
MP3•Episode home
Manage episode 174370346 series 1401837
Content provided by Adam Wathan. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Adam Wathan or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Topics include:
- Are facades and service location automatically bad?
- Are NounVerber classes anti-OO?
- Adding a layer of composition to create domain models with dependencies
- Using method injection for a temporary dependency
- Using optional parameters to improve testability
Code snippets:
- Option 1: Facades/Service Location/Global Access
- Option 2: Moving the responsibility to a new class
- Option 3: Composing a new domain model
- Option 4a: Inject the dependency into the method
- Option 4b: Optional method injection w/global fallback
Links:
- Matt's blog
- "Agent nouns are code smells" by Peter Gillard-Moss
- Nitpick CI, Adam's PSR-2 style checking service
- "Dependency injection is not a virtue" by DHH
- Erie Day of Code, Matt's conference
- Sponsored by Laracasts
152 episodes
MP3•Episode home
Manage episode 174370346 series 1401837
Content provided by Adam Wathan. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Adam Wathan or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Topics include:
- Are facades and service location automatically bad?
- Are NounVerber classes anti-OO?
- Adding a layer of composition to create domain models with dependencies
- Using method injection for a temporary dependency
- Using optional parameters to improve testability
Code snippets:
- Option 1: Facades/Service Location/Global Access
- Option 2: Moving the responsibility to a new class
- Option 3: Composing a new domain model
- Option 4a: Inject the dependency into the method
- Option 4b: Optional method injection w/global fallback
Links:
- Matt's blog
- "Agent nouns are code smells" by Peter Gillard-Moss
- Nitpick CI, Adam's PSR-2 style checking service
- "Dependency injection is not a virtue" by DHH
- Erie Day of Code, Matt's conference
- Sponsored by Laracasts
152 episodes
All episodes
×Welcome to Player FM!
Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.