File Exchange

image thumbnail

MATLAB Dependency Injection

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


Updated 21 Jul 2016

From 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 (2021). MATLAB Dependency Injection (, GitHub. Retrieved .

Comments and Ratings (5)


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? ;-)

Andy Campbell

Andy Campbell

Ah Jan beat me too it! :-P

Jan Kappen

Nice framework!
There is another article with a demo application:

Matt McDonnell

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

Inspired: MATLAB Derivatives Pricing

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!