Upgrade to Pro — share decks privately, control downloads, hide ads and more …

kotlin season 1 - Part 9 Android에서 사용하는 MVC 패턴

TaeHwan
October 23, 2016

kotlin season 1 - Part 9 Android에서 사용하는 MVC 패턴

2016년 유데미 Kotlin 강의를 공개합니다.

영상 : https://www.youtube.com/watch?v=KCDCElsFZ38

2회 분은 유데미에서 확인 가능합니다.
http://bit.ly/2UpaJUR

TaeHwan

October 23, 2016
Tweet

More Decks by TaeHwan

Other Decks in Education

Transcript

  1. Part 9 Kotlin Androidীࢲ ࢎਊೞח MVC ಁఢ Taehwan ରࣁ؀ উ٘۽੉٘

    ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 1
  2. द੘ೞӝ ੹ী যڃ ҳઑо ੓חо? • MVC : Model/View/Control •

    MVP : Model/View/Presenter • MVVM : Model/View/ViewModel ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 2
  3. द੘ೞӝ ੹ী ৵ ҳઑܳ ݈ೞחо? • Testing оמೠ ҳઑܳ о૕

    ࣻ ੓חо? • ࠭৬ ݽ؛ਸ ܻ࠙ೡ ࣻ ੓חо? • ӭՔೠ ௏٘ܳ ٜ݅য ਬ૑ ࠁࣻܳ ࡅܰѱ ೡ ࣻ ੓חо? • ೞ૑݅ ೠߣ ࢶఖೞݶ ׮ܲ ҳઑ۽ ੹ജೞӝ ए਍о? ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 3
  4. ੉ߣ ъ੄ীࢲח? • Testing оמೠ MVP ҳઑ ࢎਊ • ࠭৬

    ݽ؛ਸ ܻ࠙ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 4
  5. द੘ೞӝ ੹ী ࣗझ௏٘ח • GitHub Udemy Sample -> ࠳۠஖ 4ߣ૩

    - MVC • https://github.com/taehwandev/Kotlin-Udemy-Sample/tree/ 04-mvc ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 5
  6. MVC৬ MVP • ੹୓੸ੋ ҳઑ(Architecture)ܳ ݈ೣ • ചݶਸ ҳࢿೞחؘ ݆੉

    ॳ੉ח ಁఢ੄ ઙܨ • Model : ؘ੉ఠܳ ׸׼ • View : पઁ ࢎਊ੗о ࠁח ചݶਸ ҳࢿ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 7
  7. MVC • Control : ࢎਊ੗੄ ੑ۱ਸ ߉ח׮. ରࣁ؀ উ٘۽੉٘ ѐߊ

    ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 10
  8. MVC • View : Control۽ࠗఠ ঌܿਸ ߉Ҋ, ੉ܳ Modelҗ ೣԋ

    ࢎਊ੗੄ ച ݶਸ ҳࢿೠ׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 11
  9. MVC • Model : Data৬ ҙ۲ػ ୊ܻܳ ׸׼ ରࣁ؀ উ٘۽੉٘

    ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 12
  10. MVC ex • 1. Controlীࢲ ੑ۱੉ ߊࢤ ରࣁ؀ উ٘۽੉٘ ѐߊ

    ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 13
  11. MVC ex • 2. ؘ੉ఠ јन੉ ೙ਃೠо? ରࣁ؀ উ٘۽੉٘ ѐߊ

    ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 14
  12. MVC ex • 3. ݽ؛ਸ ా೧ ؘ੉ఠܳ সؘ੉౟ ഛੋೠ׮. ରࣁ؀

    উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 15
  13. MVC ex • 4. ݽ؛ীࢲ সؘ੉౟ ೡ ղਊ੉ ੓׮ݶ, View۽

    ੹׳ೞѢա, Control ੉ View۽ ੹׳ೠ׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 16
  14. MVC ex • 5. ߸ചػ ؘ੉ఠо ੓ਵݶ, Model۽ ࠗఠ ؘ੉ఠܳ

    ߉ইৡ׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 17
  15. MVC ex • 6. ߸ചػ ؘ੉ఠܳ ా೧ UIܳ Ӓܽ׮. ରࣁ؀

    উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 18
  16. ೞ૑݅ উ٘۽੉٘ח? • Activity/Fragment • View/Control ৉ೡਸ ೣԋೠ׮. • ex)

    OnClickListener ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 19
  17. MVC - Android class MainActivity : AppCompatActivity() { override fun

    onCreate(savedInstanceState: Bundle?) { // ... // ex) সؘ੉౟ ߡౡ val fab = findViewById(R.id.fab) as FloatingActionButton fab.setOnClickListener { // ؘ੉ఠ јन ਃ୒ // Modelী ੽Ӕ೧ࢲ ୭न ؘ੉ఠܳ ਃ୒ // ex) fun getItems(): arrayList<>() // ੹׳߉਷ ArrayListܳ ా೧ Viewܳ јन } } } ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 20
  18. MVC - Android • 1. Activity੄ OnClickListener۽ ੉߮౟ܳ ߉ח׮. ରࣁ؀

    উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 21
  19. MVC - Android • 2. ؘ੉ఠ јन੉ ೙ਃೞݶ ݽ؛ীࢲ ୭न

    ؘ੉ఠܳ ߉ח׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 22
  20. MVC - Android • 3. Viewܳ јन೧ળ׮. ରࣁ؀ উ٘۽੉٘ ѐߊ

    ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 23
  21. MVC - Android 1. Activity੄ OnClickListener۽ ੉߮౟ܳ ߉ח׮. 2. ؘ੉ఠ

    јन੉ ೙ਃೞݶ ݽ؛ীࢲ ୭न ؘ੉ఠܳ ߉ח׮. 3. Viewܳ јन೧ળ׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 24
  22. MVCܳ ࢎਊೣਵ۽ॄ ੉੼਷? • औѱ ੽Ӕ оמ • ѐߊӝр੉ ૣਸ

    ࣻ ੓׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 25
  23. MVCܳ ࢎਊೣਵ۽ॄ ױ੼਷? • Viewীࢲ ݽٚ Ѧ ೡ ࣻ ੓׮

    ࠁפ ௏٘੄ ন੉ ݆ই ૓׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 26
  24. MVCܳ ࢎਊೣਵ۽ॄ ױ੼਷? • Viewীࢲ ݽٚ Ѧ ೡ ࣻ ੓׮

    ࠁפ ௏٘੄ ন੉ ݆ই ૓׮. • ௏٘ ࠂ੟بо ֫ই૕ ࣻ ੓׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 27
  25. MVCܳ ࢎਊೣਵ۽ॄ ױ੼਷? • Viewীࢲ ݽٚ Ѧ ೡ ࣻ ੓׮

    ࠁפ ௏٘੄ ন੉ ݆ই ૓׮. • ௏٘ ࠂ੟بо ֫ই૕ ࣻ ੓׮. • View৬ Model੄ Ѿ೤بо ֫׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 28
  26. MVCܳ ࢎਊೣਵ۽ॄ ױ੼਷? • Viewীࢲ ݽٚ Ѧ ೡ ࣻ ੓׮

    ࠁפ ௏٘੄ ন੉ ݆ই ૓׮. • ௏٘ ࠂ੟بо ֫ই૕ ࣻ ੓׮. • View৬ Model੄ Ѿ೤بо ֫׮. • ਬ૑ࠁࣻо য۵׮. ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 29
  27. MVCܳ ࢎਊೣਵ۽ॄ ױ੼਷? • Viewীࢲ ݽٚ Ѧ ೡ ࣻ ੓׮

    ࠁפ ௏٘੄ ন੉ ݆ই ૓׮. • ௏٘ ࠂ੟بо ֫ই૕ ࣻ ੓׮. • View৬ Model੄ Ѿ೤بо ֫׮. • ਬ૑ࠁࣻо য۵׮. • Modelী ؀ೠ పझ౟ܳ ೧ࠁҊ र૑݅ UIܳ ਤ઱۽ ೠ పझ౟ ௏٘ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 30
  28. ଵҊ੗ܐ • Androidী MVP ޖ੘੿ ٮۄೞӝ - Intro • Android

    TODO MVP যڌѱ ੸ਊೡө? • Android Architecture Blueprints [beta] ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 31