File Exchange

image thumbnail

MATLAB Dependency Injection

version 1.0.0.0 (234 KB) by Matt McDonnell
A dependency injection framework for MATLAB.

2 Downloads

Updated 21 Jul 2016

GitHub view license on GitHub

Editor's Note: This file was selected as MATLAB Central Pick of the Week

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.

Cite As

Matt McDonnell (2020). MATLAB Dependency Injection (https://github.com/mattmcd/mdepin), GitHub. Retrieved .

Comments and Ratings (5)

Arne

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

Jan Kappen

Nice framework!
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.

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: MATLAB Derivatives Pricing