جزییات کتاب
Key FeaturesUse DI to make your code loosely coupled to manage and test your applications easily on Spring 5 and Google GuiceIdentify when to use the Constructor or the Setter approaches for better resultsWrite more maintainable Java code by decoupling your objects from their implementationsBook DescriptionDependency 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.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. 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. 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. What you will LearnUnderstand the benefits of Dependency Injection and get from a tightly coupled design to a cleaner design organized around dependencies.Set up Guice and Spring in an application so that it can be used for DIUse scopes for handling complex application scenariosIntegrate any third party library in your DI-enabled applicationUse dependency injection when writing web applicationsImplement Aspect Oriented Programming to handle common cross-cutting concerns such as logging, authentication and transactions.Write integration tests for DI applications