Full Stack Radio

34: Matt Machuga - Dealing with Dependencies in Active Record Models


Listen Later

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
...more
View all episodesView all episodes
Download on the App Store

Full Stack RadioBy Adam Wathan

  • 4.7
  • 4.7
  • 4.7
  • 4.7
  • 4.7

4.7

179 ratings


More shows like Full Stack Radio

View all
BeardyCast: гаджеты и медиакультура by 🧢 Kepka Production

BeardyCast: гаджеты и медиакультура

122 Listeners

The Stories of Mahabharata by Sudipta Bhawmik

The Stories of Mahabharata

872 Listeners

CodeNewbie by CodeNewbie

CodeNewbie

574 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

621 Listeners

The Jordan B. Peterson Podcast by Dr. Jordan B. Peterson

The Jordan B. Peterson Podcast

34,064 Listeners

Up First from NPR by NPR

Up First from NPR

56,180 Listeners

Honestly with Bari Weiss by The Free Press

Honestly with Bari Weiss

8,695 Listeners

The Rest Is Classified by Goalhanger

The Rest Is Classified

969 Listeners