Listen "34: Matt Machuga - Dealing with Dependencies in Active Record Models"
Episode Synopsis
Topics include:Are facades and service location automatically bad?Are NounVerber classes anti-OO?Adding a layer of composition to create domain models with dependenciesUsing method injection for a temporary dependencyUsing optional parameters to improve testabilityCode snippets:Option 1: Facades/Service Location/Global AccessOption 2: Moving the responsibility to a new classOption 3: Composing a new domain modelOption 4a: Inject the dependency into the methodOption 4b: Optional method injection w/global fallbackLinks:Matt's blog"Agent nouns are code smells" by Peter Gillard-MossNitpick CI, Adam's PSR-2 style checking service"Dependency injection is not a virtue" by DHHErie Day of Code, Matt's conferenceSponsored by Laracasts
ZARZA We are Zarza, the prestigious firm behind major projects in information technology.