Tags
Language
Tags
April 2024
Su Mo Tu We Th Fr Sa
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 1 2 3 4

Java 9 Dependency Injection: Write loosely coupled code with Spring 5 and Guice

Posted By: AlenMiler
Java 9 Dependency Injection: Write loosely coupled code with Spring 5 and Guice

Java 9 Dependency Injection by Nilang Patel
English | 26 Apr. 2018 | ISBN: 1788296257 | 246 Pages | AZW3/EPUB/MOBI/PDF (conv) | 10.73 MB

Key Features
Use DI to make your code loosely coupled to manage and test your applications easily on Spring 5 and Google Guice
Identify when to use the Constructor or the Setter approaches for better results
Write more maintainable Java code by decoupling your objects from their implementations

Book Description
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.

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 Learn
Understand 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 DI
Use scopes for handling complex application scenarios
Integrate any third party library in your DI-enabled application
Use dependency injection when writing web applications
Implement Aspect Oriented Programming to handle common cross-cutting concerns such as logging, authentication and transactions.
Write integration tests for DI applications