How to Use Dependency Injection to Write Maintainable Software
Are you tired of needing 50 files open to be able to understand what a single component does?
Do you find yourself wanting to change a component, then to realise that you’ll have to touch half of the code base?
Do you want to write simple tests which easily allow to verify your implementation?
Join this talk to learn an effective way to manage the dependencies through dependency injection and never have to worry about those problems again!
In this talk we’ll explore an approach and several techniques to perform dependency injection in C++, with the goal of having decoupled components which can be easily refactored and tested.
We’ll see how to manage both dependencies on data and dependencies on behaviours. We'll explore in which situations each can be used, and we'll see which libraries offer functionality to make the developer's life easy.
The talk will cover how to write components to take dependencies in an effective way and how to propagate them.
It will additionally cover more complicated cases, where components depend on multiple other components, and also how to handle deferred instantiation of dependencies (factories yay!!).
This is a concrete, practical talk which we'll give you a strategy for managing dependencies.
Join along to see how the typical code from production can be changed, and simplified, following this approach!
Francesco Zoffoli
Francesco Zoffoli is a professional Software Engineer, public speaker and book author, with experience in C++ and backend systems.
Author of the book “C++ Fundamentals”, passionate about programming languages, maintainable software and distributed systems, he has been using C++ throughout his career and personal projects. Graduated in 2016 with a MSc in Computer Systems Engineering, he joined the industry working for Bloomberg LP.
In 2020, he joined Facebook building software monitoring systems.
He enjoys using C++ to build maintainable systems that work at scale.