Skip to content

Commit a8223d9

Browse files
Update di_in_scala.md
1 parent f5fc97e commit a8223d9

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

di_in_scala.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,18 @@ DI(Dependency injection)Its a popular concept for decoupling client and server i
88
DI encourages you to use the constructor patterns which means passing the target dependency as
99
a param when the creation source object happens.
1010
## DI in scala can be achieved by 2 ways:
11-
1. Frameworks
12-
    a. subcut
13-
    b. scaldi
14-
    c. guice
15-
    d. Macwire
16-
    e. Grafter
17-
    f.  Airframe
1811

19-
2. Pure Scala
12+
- Frameworks
13+
- Macwire
14+
- scaldi
15+
- guice
16+
- subcut
17+
- Grafter
2018

21-
    a. Cake pattern =>Notes: its an anti pattern. https://kubuszok.com/2018/cake-antipattern/
22-
    b. Reader Monad => Cats Notes: Remove dependencies from function arguments, and remodel the functions as partially-curried on those dependencies.
23-
        pass them to monadic functions with run() method(not via function arguments).But it has some performance overhead and it makes the scope of dependencies ambiguous.
24-
25-
    c. Dependency Injection in Functional Programming : This approach needs to use IO Monad library like Cats Effect.
19+
- Pure Scala
20+
- Cake pattern =>Notes: its an anti pattern. https://kubuszok.com/2018/cake-antipattern/
21+
- Reader Monad => Cats Notes: Remove dependencies from function arguments, and remodel the functions as partially-curried on those dependencies.pass them to monadic functions with run() method(not via function arguments).But it has some performance overhead and it makes the scope of dependencies ambiguous.
22+
- Dependency Injection in Functional Programming : This approach needs to use IO Monad library like Cats Effect.
2623

2724

2825
## Comparison chart
@@ -46,7 +43,7 @@ a param when the creation source object happens.
4643

4744

4845

49-
Reader Monad:
46+
## Reader Monad:
5047

5148
Plain construction injection:
5249

0 commit comments

Comments
 (0)