A dependency injection framework for MATLAB.
This is loosely based on Martin Fowler's dependency injection article and Spring.
Components are set up using constructor injection. This requires each component to inherit from mdepin.Bean and have publicly settable properties for the injected services.
Matt McDonnell (2020). MATLAB Dependency Injection (https://github.com/mattmcd/mdepin), GitHub. Retrieved .
Very good framework - using it a lot!
At the moment I have the problem that I want to initialize object arrays with the dependency injection framework. Has anybody tried this yet and has a solution? Maybe the author? ;-)
Ah Jan beat me too it! :-P
There is another article with a demo application: http://blogs.mathworks.com/developer/2016/02/24/dependency-injection/
Added demo_mdepin_GUI.m showing how modular GUI can be created using dependency injection.
Inspired: MATLAB Derivatives Pricing