Titel Dependency Injection
What is Dependency Injection? “… a set of software design principles and patterns that enables us to develop loosely coupled code” - Mark Seeman
Dependency Injection with Spring4D Open Source from Stefan Glinke https://bitbucket.org/sglienke/spring4d Porting of Java Library Spring (Also available as Spring.Net) Spring covers several modern program paradigms Aspect oriented programming Class Factory DI And further more
Rules for using DI All exportable classes needs their interfaces Constructors has to follow KISS (Keep it simple and stupid) rule: - Only assignments are allowed - Constructor shall not fail - No conditional execution - Move the initialization of sub classes to a method “Initialization”
Demo
Christoph Schneider delphi@schneider-infosys.ch www.schneider-infosys.ch