# GameChanger and Anvil

DevFeed: [GameChanger and Anvil](<https://devfeed.tech/articles/gamechanger-and-anvil-19834.md>)

Original publisher: [Read original article](<https://tech.gc.com/gamechanger-and-anvil/>)

Author: GameChanger

Published: 2024-09-18T04:00:00Z

Content type: article

Language: en

Sources: [GameChanger](<https://devfeed.tech/sources/gamechanger.md>)

Topics: [Dagger](<https://devfeed.tech/topics/dagger.md>), [Dependency injection](<https://devfeed.tech/topics/dependency-injection.md>), [Android](<https://devfeed.tech/topics/android.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Code quality](<https://devfeed.tech/topics/code-quality.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code-quality](<https://devfeed.tech/tags/code-quality.md>), [dagger](<https://devfeed.tech/tags/dagger.md>), [dependency-injection](<https://devfeed.tech/tags/dependency-injection.md>), [development-tools](<https://devfeed.tech/tags/development-tools.md>), [workflows](<https://devfeed.tech/tags/workflows.md>)

## AI overview

GameChanger describes how its App Platform team integrates Anvil with an existing Dagger setup in an Android codebase. The effort streamlines dependency injection and supports modularization, consistent architecture, reduced cognitive load, faster onboarding, and improved code quality.

## Source excerpt

At GameChanger, we have a dedicated App Platform team that focuses on scaling our engineering organization and supporting development teams across the company. Our mission is to make building things the right way the easy way for all developers at GameChanger. This involves: Implementing and maintaining core infrastructure like dependency injection systems Creating and improving development tools and workflows Establishing best practices and architectural patterns Providing support and guidance to feature teams By having a dedicated team focus on these foundational aspects, we achieve several benefits: Consistency across the codebase, making it easier for developers to switch between projects Reduced cognitive load for feature teams, allowing them to focus on business logic Faster onboarding for new team members Improved code quality and maintainability The work on integrating Anvil with our existing Dagger setup is a prime example of how the App Platform team contributes to these goals. By streamlining our dependency injection process, we're making it easier for all teams to build features efficiently and correctly. With this context in mind, let's explore the technical details of our setup and why we chose to augment Dagger with Anvil. What's the setup? The Android codebase has the following Dagger components: a longstanding Application Component, a User Component that lives for as long as the user is logged in, and Game Components that last for as long as any live game. Features usually involve a fragment to render UI and a view model to manage business logic and state. Said view model is supplied by a factory in either the Application Component or User Component and pulls in dependencies from the rest of the Dagger graph that may come from any of the mentioned components. So Why Anvil? 1. Anvil makes modularization easy: We're following, as shown in the diagram above, a format for modules across the codebase to follow that involve the inversion of control princi