Java 9 Dependency Injection cover image

Java 9 Dependency Injection

By Nilang Patel, Krunal Patel
pdf
Format
2018
Year
English
Language
Packt Publishing
Publisher

Summary

<h4>Key Features</h4><ul><li>Use DI to make your code loosely coupled to manage and test your applications easily on Spring 5 and Google Guice</li><li>Identify when to use the Constructor or the Setter approaches for better results</li><li>Write more maintainable Java code by decoupling your objects from their implementations</li></ul><h4>Book Description</h4><p>Dependency Injection is a design pattern that allows us to remove the hard-coded dependencies and make our application loosely coupled, extendable and maintainable. We can implement dependency injection to move the dependency resolution from compile-time to runtime.</p><p>This book will be your one stop guide to write loosely coupled code using the latest features of Java 9 with frameworks such as Spring 5 and Google Guice. </p><p>The book begins by explaining you what Dependency Injection is and teach you about the IoC containers. From here, you will learn about the Object compositions and its role in DI and will learn to build a modular application. You will learn how to use Dependency Injection to focus your efforts on the business logic unique to your application and let the framework handle the infrastructure work to put it all together. After this, you will explore Spring and Guice, the popular frameworks for Dependency Injection and see how to define injection keys and configure them in the framework-specific level. The book will then teach you how to use dependency injection when writing web applications and implement Aspect oriented programming in Guice and Spring. </p><p>Towards the end, you will learn to integrate any third party library in your DI-enabled application and explore common pitfalls and recommendations to build a solid application with DI. </p><h4>What you will Learn</h4><ul><li>Understand the benefits of Dependency Injection and get from a tightly coupled design to a cleaner design organized around dependencies.</li><li>Set up Guice and Spring in an application so that it can be used for DI</li><li>Use scopes for handling complex application scenarios</li><li>Integrate any third party library in your DI-enabled application</li><li>Use dependency injection when writing web applications</li><li>Implement Aspect Oriented Programming to handle common cross-cutting concerns such as logging, authentication and transactions.</li><li>Write integration tests for DI applications</li></ul>

Related books


Philosophy
Varieties of Dependence: Ontological Dependence, Grounding, Supervenience, Response-Dependence
Benjamin Schnieder (ed.), Miguel Hoeltje (ed.), Alex Steinberg (ed.)
Others
Open systems dependability : dependability engineering for ever-changing systems
Mario Tokoro
Linguistics
Dependency Linguistics: Recent advances in linguistic theory using dependency structures
Kim Gerdes, Eva Hajičová, Leo Wanner
International Conferences and Symposiums
Dependable Computing — EDCC-2: Second European Dependable Computing Conference Taormina, Italy, October 2–4, 1996 Proceedings
Jean-Charles Fabre, Tanguy Pérennou (auth.), Andrzej Hlawiczka, João Gabriel Silva, Luca Simoncini (eds.)
International Conferences and Symposiums
Dependable Computing - EDCC 5: 5th European Dependable Computing Conference, Budapest, Hungary, April 20-22, 2005. Proceedings
Pascal Traverse, Isabelle Lacaze, Jean Souyris (auth.), Mario Dal Cin, Mohamed Kaâniche, András Pataricza (eds.)
International Conferences and Symposiums
Dependable Computing — EDCC-1: First European Dependable Computing Conference Berlin, Germany, October 4–6, 1994 Proceedings
Matti A. Hiltunen, Richard D. Schlichting (auth.), Klaus Echtle, Dieter Hammer, David Powell (eds.)