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

웹 어플리케이션 설계와 구현 III - 소프트웨어 구현에 관하여

웹 어플리케이션 설계와 구현 III - 소프트웨어 구현에 관하여

Manjong Han

August 01, 2018
Tweet

More Decks by Manjong Han

Other Decks in Programming

Transcript

  1. ਢ য೒ܻா੉࣌ ࢸ҅৬ ҳഅ III
    - ࣗ೐౟ਝয ҳഅী ҙೞৈ
    2018.08.01

    @ೠࣁࢎ੉ߡࠁউҊ١೟Ү

    ൤ٚ౟ۑ CTO ೠ݅ઙ

    View full-size slide

  2. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ё୓૑ೱ ೐۽Ӓې߁(Object Oriented Programming, OOP)

    - ҳઑ੸ ߑߨۿ੄ ޙઁ੼ਸ ೧Ѿೞӝ ਤ೧ ੋр੉ അप ࣁ҅ܳ ੉೧ೞח ߑधਵ۽ द
    झమਸ ѐߊೞ۰ח ֢۱ਵ۽ ఍ࢤ

    - “ؘ੉ఠ৬ ೐۽ࣁझܳ ܻ࠙ೞ૑ ঋҊ ё୓۽ ݽ؛݂”: “ੋр੉ ࢎҊೞח ߑध”

    - അप ࣁ҅ী ઓ੤ೞח ѐ֛ਸ ӝ߈ਵ۽ ೠ ё୓ۄח ة݀ػ ױਤ۽ दझమਸ ҳࢿೞ
    Ҋ, п ё୓ח ݫद૑ܳ ా೧ ࢚ഐ੘ਊ

    View full-size slide

  3. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ё୓૑ೱ ೐۽Ӓې߁(Object Oriented Programming, OOP)

    - ё୓(object)
    ‣ data + operation on data

    ‣ instance of class

    - ௿ېझ(class)
    ‣ description, abstraction

    - ݫࣁ૑(message)
    ‣ ё୓ р ࢚ഐ ੘ਊ(ݫࣗ٘ ഐ୹) ࣻױ

    View full-size slide

  4. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ё୓૑ೱ ೐۽Ӓې߁(Object Oriented Programming, OOP)

    - ୶࢚ച(abstraction)
    ‣ ࢚ࣁೠ ղਊਸ ऀӝҊ ೨ब੸ੋ ࠗ࠙(ౠ૚)ਸ ъઑೞৈ ݽ؛ച

    - ஭ङച(encapsulation)
    ‣ ੿ࠁ ਷ץਸ ా೧ ё୓ р Ѿ೤بܳ хࣗदெ ਬ૑ࠁࣻ ਊ੉, ੤ࢎਊࢿ ૐ؀

    - ࢚ࣘࢿ(inheritance)
    ‣ ೞਤ ఋੑীࢲ ࢚ਤ ఋੑ੄ ӝמਸ ࢎਊೞৈ ഛ੢ೡ ࣻ ੓ب۾ ೲਊ

    - ׮ഋࢿ(polymorphism)
    ‣ ೞਤ ఋੑীࢲ ࢚ਤ ఋੑ੉ ઁҕೞח ߑߨਸ ా೧ Ҋਬೠ ز੘ਸ ࣻ೯ оמ

    View full-size slide

  5. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - Single Responsibility Principle (SRP) ױੌ ଼੐ ਗ஗
    - Open-Closed Principle (OCP) ѐߑ ತࣧ ਗ஗
    - Liskov Substitution Principle (LSP) ܻझ௏೐ ஖ജ ਗ஗
    - Interface Segregation Principle (ISP) ੋఠಕ੉झ ܻ࠙ ਗ஗
    - Dependency Inversion Principle (DIP) ੄ઓ ৉੹ ਗ஗

    View full-size slide

  6. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ױੌ ଼੐ ਗ஗ (SRP)

    ‣ “௿ېझח ױ ೠ ѐ੄ ଼੐ਸ оઉঠ ೠ׮.”

    ‣ “௿ېझܳ ߸҃ೞח ੉ਬח ױ ೠ ѐৈঠ ೠ׮.”

    View full-size slide

  7. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ױੌ ଼੐ ਗ஗ (SRP)

    ‣ ೠ ௿ېझী ࢲ۽ ׮ܲ ੉ਬ۽ ߸҃غח ଼੐ٜ੉ ҕઓೞҊ ੓׮ݶ 

    SRPܳ ਤ߈ೞҊ ੓׮ח ૐѢ

    ‣ ೧׼ ௿ېझ੄ п ݫٜࣗ٘੉ ־ҳী ੄೧ प೯غח૑ ഛੋ റ ܻ࠙

    ‣ ௿ېझ੄ ഐ୹੗ٜ੉ ࢲ۽ ׮ܲ ݫٜࣗ٘ਸ ࢎਊೠ׮ݶ, Ӓ ݫٜࣗ٘਷ пӝ ׮
    ܲ ଼੐ী ࣘೡ оמࢿ੉ ֫׮. ੉ী ٮۄ ঌݏѱ ௿ېझܳ ܻ࠙ೞب۾ ೠ׮.

    View full-size slide

  8. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ѐߑ ತࣧ ਗ஗ (OCP)

    ‣ “ഛ੢ীח ৌ۰ ੓যঠ ೞҊ, ߸҃ীח ײഃ ੓যঠ ೠ׮.”

    ‣ “ӝמਸ ߸҃ೞѢա ഛ੢ೡ ࣻ ੓ਵݶࢲ,

    Ӓ ӝמਸ ࢎਊೞח ௏٘ח ࣻ੿غ૑ ঋইঠ ೠ׮.”

    ‣ ӝמਸ ഛ੢ೞݶࢲب ӝמਸ ࢎਊೞח ӝઓ௏٘ח ߸҃غ૑ ঋইঠ ೠ׮.

    View full-size slide

  9. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ѐߑ ತࣧ ਗ஗ (OCP)

    ‣ ഛ੢غח ࠗ࠙(૊, ߸ചೞח ࠗ࠙)ਸ ୶࢚ച೧ࢲ ೧Ѿ оמೞ׮.

    1. ੋఠಕ੉झܳ ੉ਊೠ ୶࢚ച ߑߨ

    2. ࢚ࣘਸ ੉ਊೠ ࢚ਤ ௿ېझ۽੄ ୶࢚ച ߑߨ

    View full-size slide

  10. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ѐߑ ತࣧ ਗ஗ (OCP)

    ‣ ইې੄ ҃਋ ؀ࠗ࠙਷ OCPܳ ਤ߈ೞҊ ੓׮ח ૐѢ׮.

    1. ׮਍நझ౴ਸ ೠ׮. (instanceof ࢎਊ)

    2. ࠺तೠ if-else ࠶۾੉ ৈۤ ઓ੤ೠ׮.

    View full-size slide

  11. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ѐߑ ತࣧ ਗ஗ (OCP)

    ‣ ߸ച৬ ҙ۲ػ ҳഅ(߸ചо ৘࢚غח ࠗ࠙)ਸ ୶࢚ചೞח Ѫ੉ ೨ब

    ‣ OCPܳ ా೧ࢲ ߸҃੄ ਬোೣਸ ઁҕೡ ࣻ ੓਺

    View full-size slide

  12. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ܻझ௏೐ ஖ജ ਗ஗ (LSP)

    ‣ “࢚ਤ ఋੑ੄ ё୓ܳ ೞਤ ఋੑ੄ ё୓۽ ஖ജ೧ب ࢚ਤ ఋੑਸ ࢎਊೞח ೐۽Ӓ
    ۔਷ ੿࢚੸ਵ۽ ز੘೧ঠ ೠ׮.”

    View full-size slide

  13. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ܻझ௏೐ ஖ജ ਗ஗ (LSP)

    ‣ OCPח ୶࢚ച(ੋఠಕ੉झ ҳഅ)৬ ׮ഋࢿ(࢚ࣘ)ਸ ా೧ ೧Ѿ

    ‣ LSPח OCPܳ ߉୛઱ח ׮ഋࢿী ҙೠ ਗ஗ਸ ઁҕ

    View full-size slide

  14. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ܻझ௏೐ ஖ജ ਗ஗ (LSP)

    ‣ ইې੄ ҃਋ ؀ࠗ࠙਷ LSPܳ ਤ߈ೞҊ ੓׮ח ૐѢ׮.

    1. ݺदػ ݺࣁীࢲ ߩযդ чਸ ܻఢೠ׮.

    2. ݺदػ ݺࣁীࢲ ߩযդ ৘৻ܳ ߊࢤೠ׮.

    3. ݺदػ ݺࣁীࢲ ߩযդ ӝמਸ ࣻ೯ೠ׮.

    View full-size slide

  15. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ੋఠಕ੉झ ܻ࠙ ਗ஗ (ISP)

    ‣ “ੋఠಕ੉झח Ӓ ੋఠಕ੉झܳ ࢎਊೞח ௿ۄ੉঱౟ܳ ӝળਵ۽ ܻ࠙غযঠ ೠ
    ׮.”

    ‣ “௿ۄ੉঱౟ח ੗न੉ ࢎਊೞח ݫࣗ٘ী݅ ੄ઓ೧ঠ ೠ׮.”

    View full-size slide

  16. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ੋఠಕ੉झ ܻ࠙ ਗ஗ (ISP)

    ‣ ࢎਊೞ૑ ঋח ੋఠಕ੉झ੄ ߸҃ী ੄೧ࢲ ߊࢤೞח ࠛ೙ਃೠ ৔ೱ(ࣗझ ੤ஹ౵
    ੌ ١)ਸ ޷஘׮ݶ ISPܳ ਤ߈ೞҊ ੓׮ח ૐѢ

    ‣ ௿ۄ੉঱౟ ੑ੢ীࢲ ࢎਊೞח ӝמ݅ ઁҕೞب۾ ੋఠಕ੉झܳ ܻ࠙

    ‣ ೞա੄ ӝמী ؀ೠ ߸҃੄ ৈ౵ܳ ୭ࣗച೧ળ׮.

    View full-size slide

  17. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ੄ઓ ৉੹ ਗ஗ (DIP)

    ‣ “Ҋࣻળ ݽٕ਷ ੷ࣻળ ݽٕ੄ ҳഅী ੄ઓ೧ࢲח উػ׮.”

    ‣ “੷ࣻળ ݽٕ੉ Ҋࣻળ ݽٕীࢲ ੿੄ೠ ୶࢚ ఋੑী ੄ઓ೧ঠ ೠ׮.”

    View full-size slide

  18. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ۽ߡ౟ ݃౯੄ SOLID ਗ஗

    - ੄ઓ ৉੹ ਗ஗ (DIP)

    ‣ ੷ࣻળ ݽٕ੉ ߸҃غ؊ۄب Ҋࣻળ ݽٕ਷ ߸҃غ૑ ঋইঠ ೠ׮.

    View full-size slide

  19. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ё୓૑ೱ ೐۽Ӓې߁੄ ੢੼: ݽٕࢿ(modularity), ਬোࢿ(flexibility), ഛ੢ࢿ
    (extensibility), ਬ૑ҙܻࢿ(maintainability)

    • “ಁఢ(pattern)”ਸ ా೧ ё୓૑ೱ ೐۽Ӓې߁੄ ੢੼ਸ पഅ

    - ௏٘ ױਤ(code level): ீ౟߭੄ ~ҳഅ ಁఢ, ۽ߡ౟ ݃౯੄ ~Clean Code

    - ௿ېझ ױਤ(class level): GoF੄ ~٣੗ੋ ಁఢ, ݃౯ ౵਎۞੄ ~ܻಂష݂

    - ಁః૑, ݽٕ ױਤ(package level): ীܼ ী߈झ੄ ~Domain Driven
    Development, ݃౯ ౵਎۞੄ ~PoEAA

    View full-size slide

  20. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • GoF੄ ٣੗ੋ ಁఢ

    - ࣗ೐౟ਝয ҳഅীࢲ ੗઱ ߊࢤೞח ޙઁী ؀ೠ ೧Ѿ ߑߨਸ ੿ܻ

    - ё୓૑ೱ ঱য(C++, झށష௼)ܳ ӝ߈ਵ۽ ಁఢചػ ߑߨ

    - ࢤࢿ ಁఢ(Creational Pattern), ҳઑ ಁఢ(Structural Pattern), ೯ز ಁఢ
    (Behavioral Pattern)

    View full-size slide

  21. ё୓૑ೱ ࣗ೐౟ਝয ѐߊ
    • ীܼ ী߈झ੄ Domain Driven Development

    - Ҋё, ࠺ૉפझ, ਃҳࢎ೦੄ بݫੋਸ ੜѱ ݽ؛݂ೞҊ ҳഅೞӝ ए਍, ੉೧ೞӝ ए
    ਍ ҳઑ۽ ࣗ೐౟ਝযܳ ࢸ҅ೞӝ ਤೠ ߑߨ

    - بݫੋীࢲ ൔ൤ ࢎਊغח ਊযܳ ӝ߈ਵ۽ ೠ Ubiquitous Language ࢎਊ

    - ೞਤ بݫੋ੄ ৉ೡ/ҙबࢎܳ ઺बਵ۽, ઑ૒ਸ ӝળਵ۽ Bounded Context ૑੿

    - بݫੋ ݽ؛਷ Entity, Value Object, Service, Aggregate ١੄ ਃࣗ۽ ಴അ

    View full-size slide

  22. Reference

    https://en.wikipedia.org/wiki/Unified_Modeling_Language

    http://contents.kocw.or.kr/document/lec/2011/33/04/Ch01.pdf

    http://byul124.cafe24.com/blog/wp-content/uploads/1/1059072550.pdf

    http://cjmyun.tripod.com/Knowledgebase/ConceptsOfObjectOriented.htm

    View full-size slide