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

Peacock#01 ソフトウェアアーキテクチャ的発想

kinocoboy
November 30, 2021
200

Peacock#01 ソフトウェアアーキテクチャ的発想

kinocoboy

November 30, 2021
Tweet

More Decks by kinocoboy

Transcript

  1. Self Introduction Hiroki.Kinoshita Peacock Engineer Group ( PEG ) Organizer

    גࣜձࣾKUNO ਂ૚ֶशͱCloudΛۦ࢖͢ΔDXਪਐاۀ Front Engineer / Designer Twitter: @kinocoboy2 Blog: Baboblog
  2. Peacock Engineer Group • PEG ͷ ໨త • ஍Ҭ΍ձࣾɾࣾձਓɾֶੜͳͲͷ֞ࠜΛӽ͑ͯɺ ࣗ༝ʹָٕ͘͠ज़ྗΛߴΊ߹͑ΔίϛϡχςΟ

    ʹ!! • PEG ͕औΓѻ͏ςʔϚ • ʮ໌೔͔Β࢖͑ΔTipsʯ • ӡӦελοϑਵ࣌ืूத!
  3. Πϕϯτͷָ͠Έํ • Twitter ͱSpecialChat Λۦ࢖ • #PEACOCK • ͲΜͲΜᄁ͍͍͖ͯ·͠ΐʔ •

    ࣭໰͸ɺTwitter Ͱ΋͍͍͠ɺSpecialChat ͷ νϟοτཝ͔ΒͰ΋OKͰ͢ɻ • ΦϯϥΠϯͳͷͰੵۃతʹ΍ͬͯΈ·͠ΐʔ • ࠙਌ձ΋༗ࢤͰߦ͍·͢ɻ • SpecialChat ͷ ޿৔Ͱߦ͍·͢ɻ • ৭ʑަྲྀ͠·͠ΐʔ
  4. ྫ୊ • ੹೚ൣғͷ෼ղΛ஌Βͣ • ಈ͘΋ͷ͚ͩΛ໨ࢦͨ͠ͷͰςετ΋࣮ࡍʹಈ͔ ͯ͠ΈͨΓ͢Δײ͡ • ͔֬ʹಈ͕͘… • શͯ

    main ʹ٧ΊࠐΜͰ͍ΔͷͰɺͲ͔͜Ͱτϥ ϒϧ͕ى͖ͨΒ main શମΛ debug ͠ͳ͚Ε ͹… • Main ͷ ςετͬͯ݁ہԿΛνΣοΫ͢Ε͹… ͱ͋ΔώϤίʔυ🐥
  5. ྫ୊ • ·ͣҰ൪ͪ͝Ό͍͍ͭͯΔdatabase ૄ௨पΓ͔Βɻ • Main Λಈ͔͢ͱ͖ɺdatabase instance ·Ͱཱͪ ্͔͛ͯΒquery

    Λൃߦ͢Δ࢓૊Έʹͳ͍ͬͯ Δɻ • ·ͣ͸ query ͷ෦඼ͷ੹೚ൣғΛ֎ͯ͠ΈΔɻ • Query Λ࣮ߦ͢ΔͨΊʹ͸ɺ database instance ͱ query param ͕͋Ε͹෼ղͰ͖ΔͷͰɺ model ͱ͍͏ྖҬΛ࡞ͬͯDBͱ΍ΓͱΓΛͤ͞ ͨɻ • ͜ΕʹΑͬͯɺDBपΓͰτϥϒϧ͕ى͖ͨ Βɺmodel ͚ͩΛݟΕ͹ྑ͘ͳͬͨ ͱ͋ΔώϤίʔυ🐥
  6. ྫ୊ • ࣍ʹmain Λىಈ͢Δͨͼʹຖճ database instance up ͍ͯ͠Δ෦෼Λ΍ΊΑ͏ɻ • Main

    Λಈ͔ͨ͢Ίʹɺ model ͕ඞཁͰ͋Γɺ model ͸ database instance Λཉ͕͠ΔͳΒɺ main ʹ΋ database instance Λ֎͔Β༩͑ͯ͋͛ Ε͹ྑ͍ɻ • ͜ͷରԠͰɺdatabase instance ͸ γεςϜͰ୯ ҰͰ͋Δܗ͕໿ଋ͞ΕΔɻ͜Ε͸singleton ͱ͍͏ σβΠϯύλʔϯɻ • Main ͷςετΛ͢Δͱ͖ɺ database instance ͱ query parameter ΛೖΕͨΒಈ࡞֬ೝ͕औΕΔΑ ͏ʹͳͬͨɻ ͱ͋ΔώϤίʔυ🐥
  7. ྫ୊ • ࣍ʹbusiness logic Λmain ͔Β෼཭͠Α͏ɻ • ͜Εͷ෼཭ʹ͸ɺ query ͷ

    result ͕͋Ε͹logic ͸ճͤͦ͏ͩɻ • Main ؔ਺Ͱ͸ͳ͘ɺ logic function ͱͯ͠ߟ͑ Δɻ • Logic Λ෼཭ͤ͞Δ͜ͱͰɺ main ͷಈ࡞֬ೝ Ͱඞཁͳ͜ͱ͸ param parse ͱ param validate ͷΈ࢒͞Ε͍ͯΔɻ • Logic ͸ model result ͕͋Ε͹ɺ୯ମͰςε τͰ͖Δ͔Βͩɻ ͱ͋ΔώϤίʔυ🐥