{"id":226,"date":"2018-07-18T08:03:03","date_gmt":"2018-07-18T01:03:03","guid":{"rendered":"https:\/\/lhkbob.com\/blog\/?page_id=226"},"modified":"2018-07-20T10:53:23","modified_gmt":"2018-07-20T03:53:23","slug":"dependency-injection-with-static-analysis-and-context-aware-policy","status":"publish","type":"page","link":"https:\/\/lhkbob.com\/blog\/publications\/dependency-injection-with-static-analysis-and-context-aware-policy\/","title":{"rendered":"Dependency Injection with Static Analysis and Context-Aware Policy"},"content":{"rendered":"<p><a href=\"https:\/\/lhkbob.com\/blog\/wp-content\/uploads\/2018\/07\/jot-2016-teaser.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium_large wp-image-283\" src=\"https:\/\/lhkbob.com\/blog\/wp-content\/uploads\/2018\/07\/jot-2016-teaser-768x266.png\" alt=\"\" width=\"768\" height=\"266\" srcset=\"https:\/\/lhkbob.com\/blog\/wp-content\/uploads\/2018\/07\/jot-2016-teaser-768x266.png 768w, https:\/\/lhkbob.com\/blog\/wp-content\/uploads\/2018\/07\/jot-2016-teaser-300x104.png 300w, https:\/\/lhkbob.com\/blog\/wp-content\/uploads\/2018\/07\/jot-2016-teaser-1024x355.png 1024w, https:\/\/lhkbob.com\/blog\/wp-content\/uploads\/2018\/07\/jot-2016-teaser.png 1542w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/a>Michael D. Ekstrand and <strong>Michael Ludwig<\/strong>. 2016. Dependency Injection with Static Analysis and Context-Aware Policy.\u00a0<em>Journal of Object Technology<\/em> 15, 1 (February 2016), 1-31. DOI: <a class=\"doi\" href=\"https:\/\/dx.doi.org\/10.5381\/jot.2016.15.5.a1\">10.5381\/jot.2016.15.5.a1<\/a><\/p>\n<ul>\n<li><a href=\"http:\/\/www.jot.fm\/contents\/issue_2016_01\/article1.html\">Official Version<\/a><\/li>\n<li><a href=\"https:\/\/md.ekstrandom.net\/pubs\/grapht\">Michael Ekstrand&#8217;s Page<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/grouplens\/grapht\">Source Code<\/a><\/li>\n<\/ul>\n<h3>Abstract<\/h3>\n<p>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 <em>context-aware policy<\/em>, 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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Michael D. Ekstrand and Michael Ludwig. 2016. Dependency Injection with Static Analysis and Context-Aware Policy.\u00a0Journal of Object Technology 15, 1 (February 2016), 1-31. DOI: 10.5381\/jot.2016.15.5.a1&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":191,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"_links":{"self":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/pages\/226"}],"collection":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/comments?post=226"}],"version-history":[{"count":2,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/pages\/226\/revisions"}],"predecessor-version":[{"id":284,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/pages\/226\/revisions\/284"}],"up":[{"embeddable":true,"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/pages\/191"}],"wp:attachment":[{"href":"https:\/\/lhkbob.com\/blog\/wp-json\/wp\/v2\/media?parent=226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}