what you do in composition is tight coupling and it is not easy to dynamically change or add behaviour. In dependency injection you have the flexibility to dynamically add new behaviours to the Warrior class or test it with dummy data class. so in your code if warrior will only have reputation then you can go with composition but if you want the flexibility to add more features to the warrior then DI will do it better.