Journal article
Dependency Injection with Static Analysis and Context-Aware Policy
Journal of object technology, v 15(1)
01 Jan 2016
Abstract
The dependency injection design pattern improves the configurability, testability, and maintainability of object-oriented applications by decoupling components from both the concrete implementations of their dependencies and the strategy employed to select those implementations. In recent years, a number of libraries have emerged that provide automated support for constructing and connecting dependency-injected objects. Our experience developing systems with these tools has led us to identify two shortcomings of existing dependency injection solutions: the mechanisms for specifying component implementations often make it difficult to write and configure systems of arbitrarily-composable components, and the toolkit implementations often provide limited capabilities for inspection and static analysis of the object graphs of dependency-injected systems. We present GRAPHT, an new dependency injection container for Java that addresses these issues by providing context-aware policy, allowing component implementation decisions to depend on where in the object graph a component is required, and using a design that allows for static analysis of configured object graphs. To achieve its objectives, GRAPHT is built on a mathematical representation of dependency injection and object graphs that facilitates static analysis and straightforward implementation, and forms a basis for further consideration of the capabilities of dependency injection. The mathematical representation includes context-aware policy that we show to be strictly more expressive than the qualified dependencies used in many current toolkits. We demonstrate the utility of our approach with a case study showing how GRAPHT has aided in the development of the LENSKIT recommender systems toolkit.
Metrics
12 Record Views
Details
- Title
- Dependency Injection with Static Analysis and Context-Aware Policy
- Creators
- Michael D. Ekstrand - Texas State Univ, Dept Comp Sci, San Marcos, TX 78666 USAMichael Ludwig - University of Minnesota
- Publication Details
- Journal of object technology, v 15(1)
- Publisher
- Journal Object Technology
- Number of pages
- 31
- Grant note
- 05-34939; 08-08692; 08-12148; 10-17697 / National Science Foundation under IIS grants
- Resource Type
- Journal article
- Language
- English
- Academic Unit
- Information Science
- Web of Science ID
- WOS:000378648200001
- Other Identifier
- 991021818498304721
InCites Highlights
Data related to this publication, from InCites Benchmarking & Analytics tool:
- Collaboration types
- Domestic collaboration
- Web of Science research areas
- Computer Science, Software Engineering