mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-04 00:56:07 +01:00
0294ee68a7
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
25 lines
813 B
Text
25 lines
813 B
Text
Dependency Injection (DI) involves passing (injecting) one or more
|
|
dependencies (or services) to a dependent object (or client) which
|
|
become part of the client's state. It is like the Strategy Pattern,
|
|
except the strategy is set once, at construction. DI enables loosely
|
|
coupled designs, which are easier to maintain and test.
|
|
|
|
Features:
|
|
|
|
- None run-time overhead;
|
|
- Compiles fast;
|
|
- Gives short diagnostic messages;
|
|
- Is non-intrusive;
|
|
- Reduces boilerplate code;
|
|
- Reduces testing effort;
|
|
- Gives better control of what and how is created;
|
|
- Gives better understanding about objects hierarchy.
|
|
|
|
Design goals:
|
|
|
|
- Be as fast as possible;
|
|
- Compile as fast as possible;
|
|
- Give short and intuitive error messages;
|
|
- Guarantee object creation at compile-time;
|
|
- Be as non-intrusive as possible;
|
|
- Be easy to extend.
|