© Luqman Saeed 2020Luqman SaeedIntroducing Jakarta EE CDIhttps://doi.org/10.1007/978-1-4842-5642-8_8
8. The Contexts and Dependency Injection (CDI) API
Dependency injection (DI) is a way of developing software such that various components are related in a very loosely coupled way. In most software applications, there is always some form of dependency between the various bits and pieces.
Take a restaurant application for instance. You might have a component that handles taking orders, another for sending a message to the kitchen, yet another for checking available ingredients for a given meal, and one or two for calculating the total bill.
These are all various components that need to depend on each other to fulfill the ...