본문 바로가기
[android] Dagger2 tutorial part2 Dependency Injection in Android https://blog.mindorks.com/introduction-to-dagger-2-using-dependency-injection-in-android-part-1-223289c2a01b - Dependency Injection = Inversion of Control - 한 java class 에서 다른 java class 를 new operator 로 생성하면 test 하는 것이 쉽지 않다. 이를 hard dependency 라고 부른다. - Dagger1 은 reflection 을 사용해서 DI 를 수행했었다. 이는 많은 단점을 가지는데, 우선 느리고, 두번째는 작업이 runtime 에서 수행이 되며, 세번째는 예상치 못한 crash .. 2018. 12. 5.
[android] Dagger2 for Android Beginners - Dagger 는 static, compile-time dependency injection framework 이다. 기존 버전(1.x)은 Square 에 의해 만들어졌고, 새 버전은 (2.x) Google 에 의해 유지보수되고 있다. - Hard dependency 는.. reusability 를 감소시킨다. testing 을 어렵게 한다. 코드의 scale up 이나 유지보수를 어렵게 한다. - Dependency 에는 다음의 type 이 있다. class, interface ,method/field, direct/indirect - java 에서 new operator 로 instance 를 생성하면, 독립적으로 test 되기가 어렵다. 이를 dependency 라 불린다. - Dependency.. 2018. 12. 3.
[android] Annotation Processing 에 대한 이야기 [android] Annotation Processing 에 대한 이야기 http://hannesdorfmann.com/annotation-processing/annotationprocessing101 The Basics -annotation processing 은 compile time 에 annotation 을 확인하여 어떤 action 을 하는 것을 이야기한다. -annotation processing 은 Java 5 부터 가능하다.그러나 사용할만한 API 는 Java 6 에 release 되었다. -annotation processor 는 java code 나 byte code 를 input 으로 받아서 java 파일로 output 을 생성한다.이 생성된 output 은 compile time 에.. 2017. 7. 31.
반응형