Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is Dependency Injection?
Think of the television remote needing batteries.
Why is reducing tight coupling important in software design?
Consider how changing batteries can make a remote work better.
What does Dependency Injection allow an object to do?
Think about how the remote gets its power.
True or False: Tight coupling makes a system easier to maintain.
Recall how the remote would be affected by battery changes if it created its own batteries.
Design a small application in Java that utilizes Dependency Injection to manage a class representing a Smart Light and its required power source.
Think about how you would approach creating a light that could use different types of energy sources.
Describe a situation where tight coupling could severely impact the maintainability of an application. Provide a solution that uses Dependency Injection.
Consider the pros and cons of making every class responsible for creating its own dependencies.
4 more questions in this section. Enroll free to practise them all.
Enroll free