Development Concepts
ML code still has to be software, and software has names for the shapes that keep it maintainable. The page starts with design patterns, the catalogue of those shapes, and then moves to dependency injection and SOLID, the object-oriented rules underneath them.
Patterns
Before any rule, it helps to see the patterns side by side. Software and architectural design patterns is DovAmir's curated list of software and architecture related design patterns, and the figure below is taken from it.

Programming concepts
With the patterns named, the next question is why they are built the way they are, and dependency injection is the clearest example. Dependency injection is Bhavya Karia's quick intro: one object supplies the dependencies, the services, of another. It is based on SOLID: the class should do one thing, so we are letting other classes create 3rd party/class objects for us instead of doing it internally, either by init passing or by injecting in runtime.
That single-responsibility rule is only the first letter. SOLID — the five principles of object oriented design, explained as the way to write cleaner, scalable, and maintainable code.
Last updated
Was this helpful?