Design Problems
-
Creating Objects
-
How can a class be independent
of how the objects it requires are created?
-
How can a class accept
the objects it requires (from an injector object)
instead of creating the objects directly?
-
Specifying Different Configurations
-
How can the way objects are created
(the mapping of interfaces to implementations)
be specified
in separate configuration files or objects?
-
How can an application support different configurations?
-
Resolving Dependencies Recursively
-
How can the objects a class requires
be created recursively?
Refactoring Problems
-
Inflexible Code
-
How can instantiating concrete classes throughout
an
application
(compile-time implementation dependencies)
be refactored?
-
How can object creation that is distributed across
an application
be centralized and externalized?
Testing Problems
-
Unit Testing
-
How can the objects a class requires
be replaced with mock objects
so that the class can be unit tested in isolation?