Slide 1

Slide 1 text

ϦΞʔΩςΫνϟʹΑͬͯ Ͳ͏ͳΓ͍͔ͨ ԿΛ෼͚ͯɺԿΛڞ༗͢Δ͔ 2023/09/14 ϛϥΠτσβΠϯɹ΄͛͞Μ

Slide 2

Slide 2 text

؆୯ʹࣗݾ঺հ

Slide 3

Slide 3 text

suzuki-hoge ( ΄͛͞Μ ) όοΫΤϯυ։ൃ 12 ೥͘Β͍

Slide 4

Slide 4 text

Zenn Ͱ Book Λॻ͍ͨΓ

Slide 5

Slide 5 text

YouTube Ͱมͳ͜ͱ΍ͬͨΓ

Slide 6

Slide 6 text

࠷ۙͪΐͬͱӫཆΛؾʹͯ͠·͢

Slide 7

Slide 7 text

ϨΠϠʔɾύοέʔδɾΫϥε ͷ෼͚ํ

Slide 8

Slide 8 text

ࣗ෼ͷϓϩδΣΫτͷ ߏ੒Λઆ໌Ͱ͖·͔͢ʁ

Slide 9

Slide 9 text

͜Ε͸ DB ಡΈॻ͖ ͢Δͱ͖ʹॻ͘΍ͭ ͜Ε͸ݖݶνΣοΫ ͢Δͱ͖ʹॻ͘΍ͭ

Slide 10

Slide 10 text

Ͳ͏ͯͦ͠͏ͳ͍ͬͯΔ͔ આ໌Ͱ͖·͔͢ʁ

Slide 11

Slide 11 text

ࠓճͷϦΞʔΩςΫνϟͷ ݕূϑΣʔζͰௐ੔தͷߏ੒

Slide 12

Slide 12 text

Presentation Application Infrastructure Domain QueryService QueryServiceImpl Repository UseCase Request Controller RepositoryImpl Factory DomainService ू໿ Interface Class

Slide 13

Slide 13 text

ίʔυ ڊେͳ͔ͨ·ΓΛॱΛ௥ͬͯ෼ղͯ͠ɺ Ͳ͏͖ͯ͠͞΄ͲͷਤʹͳΔ͔͓࿩͠·͢

Slide 14

Slide 14 text

෼͚Δͱڞ༗͢Δʹ ஫໨ͯ͠ߟ͑Δ

Slide 15

Slide 15 text

͓அΓ

Slide 16

Slide 16 text

Repository ΍ ू໿ ͳͲͷ୯ޠ͸ ฉ͍ͨ͜ͱ͸͋Δͱ͍͏લఏͰਐΊ·͢

Slide 17

Slide 17 text

Ұ෦ύοέʔδ͸࣌ؒͷ౎߹ͰৄࡉΛׂѪ͠·͢ ޙ೔ϊʔΧοτεϥΠυΛΞοϓ༧ఆͰ͢ͷͰɺ Α͚Ε͹ͦͪΒΛ͝ཡ͍ͩ͘͞

Slide 18

Slide 18 text

෼͚Δ

Slide 19

Slide 19 text

ྫ ͋ΔֶߍͷੜెΛ෼͚͍ͨ

Slide 20

Slide 20 text

A ͞Μ B ͞Μ C ͞Μ D ͞Μ Ͳ͏΍ͬͯ෼͚Δ͔

Slide 21

Slide 21 text

A ͞Μ B ͞Μ C ͞Μ D ͞Μ ਐ࿏૬ஊΛ͢Δ͔Β ઐ߈ผʹ෼͚Δ จܥ ཧܥ

Slide 22

Slide 22 text

A ͞Μ B ͞Μ C ͞Μ D ͞Μ ෦׆ಈର߅ϦϨʔΛ͢Δ͔Β ෦׆ผʹ෼͚Δ ໺ٿ෦ όεέ෦ ςχε෦

Slide 23

Slide 23 text

෼͚Δͱ͖͸໨త͕͋Δ

Slide 24

Slide 24 text

Ͱ͸ίʔυΛ෼͚Δ໨త͸

Slide 25

Slide 25 text

1. ϏδωεͱίʔυΛ࿈ಈ͍͔ͤͨ͞Β 2. ଎͘։ൃͰ͖ΔΑ͏ʹ͍͔ͨ͠Β

Slide 26

Slide 26 text

1. ϏδωεͱίʔυΛ ࿈ಈ͍ͤͨ͞

Slide 27

Slide 27 text

Ͳ͏ͯ͠࿈ಈ͍͔ͤͨ͞ γεςϜ ར༻ऀ asken ༷ͷαʔϏε

Slide 28

Slide 28 text

γεςϜ͸ϏδωεͷͨΊʹ͋Δ γεςϜ ར༻ऀ asken ༷ͷαʔϏε ͻͱͼͱͷ໌೔Λ ࠓ೔ΑΓ݈߁ʹ͢Δ ϏδωεαΠυ اըɾӡӦɾӦۀɾ෼ੳ

Slide 29

Slide 29 text

ϏδωεΛແࢹͨ͠։ൃ͸Ͱ͖ͳ͍ γεςϜ ར༻ऀ ϏδωεαΠυ ։ൃऀ asken ༷ͷαʔϏε اըɾӡӦɾӦۀɾ෼ੳ ։ൃ

Slide 30

Slide 30 text

ίʔυ͸ڞ༗Ͱ͖ͳ͍͔ΒυϝΠϯ஌ࣝͱͯ͠ڞ༗͢Δ γεςϜ ར༻ऀ asken ༷ͷαʔϏε ϏδωεαΠυ ։ൃऀ υϝΠϯ஌ࣝ

Slide 31

Slide 31 text

Ͱ͸Ϗδωεͷίʔυͱ͸

Slide 32

Slide 32 text

ಉ͜͡ͱΛ࣮ݱ͢Δ 2 ͭͷίʔυ ৯ࣄه࿥഑ྻ< औಘ औಘ औಘ > GPS৯ࣄه࿥JO৯ࣄه࿥഑ྻ\ JG৯ࣄه࿥৯ࣄJTOVMM\ CSFBL ^ ^ ࠓ೔ͷΞυόΠεεςʔλε อଘ ࠓ೔ͷΞυόΠε ̏৯෼ͷ৯ࣄه࿥औಘ JG̏৯෼ͷ৯ࣄه࿥શͯೖྗࡁ \ ࠓ೔ͷΞυόΠεදࣔղې ^ อଘ ࠓ೔ͷΞυόΠε

Slide 33

Slide 33 text

ίʔυΛඇΤϯδχΞʹઆ໌ͯ͠ΈΔ શͯͷ৯ࣄه࿥ͷɺ͋ɺேன൩͕ ͳΜͰ͚͢ͲɺͦΕͷશ෦ͷ৯ ࣄ͕࣌ؒOVMM͡Ό͋ͳ͚Ε͹ɺͭ ·Γ৯ࣄΛه࿥͍ͯ͠ΔͬͯΈͳͤ Ε͹ɺΞυόΠεͷදࣔεςʔλε ʹΛ୅ೖͯ͠อଘ͠·͢ ̏৯෼ͷ৯ࣄه࿥Λऔಘ͠ɺͦΕ͕ શͯೖྗࡁͳΒɺΞυόΠεΛදࣔ ղېͱͯ͠อଘ͠·͢

Slide 34

Slide 34 text

զʑ։ൃऀ͕΍Δ͜ͱ ৚݅ʹԠͯ͡ΞυόΠεͷදࣔΛղې͢Δ͜ͱͰ͋ͬͯ அͯ͡ 2 Λ୅ೖ͢Δ͜ͱͰ͸ͳ͍

Slide 35

Slide 35 text

આ໌͠ͳ͔ͬͨ͜ͱɾઆ໌ͨ͜͠ͱ ɾσʔλߏ଄ ɹɾேன༦ͷࣝผํ๏ ɹɾԿΛ࣋ͬͯೖྗࡁΈͱ͢Δ͔ ɹɾද੍ࣔޚΛͲ͏࣮ݱ͍ͯ͠Δ͔ ɾॲཧͷৄࡉϑϩʔ ɹɾGPSจ΍CSFBLจ ɾ̏৯෼ͷ৯ࣄه࿥͕ඞཁͰ͋Δ ɾશͯೖྗࡁΈͰͳ͍ͱ͍͚ͳ͍ ɾΞυόΠεͷද͕ࣔղې͞ΕΔ γεςϜͷͨΊͷίʔυ ϏδωεͷͨΊͷίʔυ ͕͜͜υϝΠϯͷίʔυ

Slide 36

Slide 36 text

ϏδωεͷίʔυΛ Domain ύοέʔδʹ ·ͱΊ͓ͯ͘ͱڞ༗͠΍͍͢

Slide 37

Slide 37 text

ύοέʔδਤʹ൓ө

Slide 38

Slide 38 text

ͦΕҎ֎ Domain ίʔυ ίʔυ ɾϏδωεͷͨΊͷίʔυ ɾυϝΠϯΛ࿈ܞͤ͞ΔͨΊͷίʔυ ɾHTTP ϦΫΤετͷͨΊͷίʔυ ɾσʔλϕʔεಡΈॻ͖ͷͨΊͷίʔυ

Slide 39

Slide 39 text

2. ଎͘։ൃͰ͖Δ Α͏ʹ͍ͨ͠

Slide 40

Slide 40 text

Ϗδωεͷίʔυ͚ͩ ෼཭͓͚ͯ͠͹͍͍ͷ͔

Slide 41

Slide 41 text

΋͠େ͖ͳίʔυϒϩοΫʹ ͍Ζ͍Ζͳίʔυ͕͍ࠞͬͯͨ͡Β

Slide 42

Slide 42 text

͋Δཧ༝Ͱมߋ͢Δͱ͜Ζ ࠓճ͸มߋ͠ͳ͍ͱ͜Ζ

Slide 43

Slide 43 text

৺഑͔ͩΒςετ͢Δͱ͜Ζ

Slide 44

Slide 44 text

৺഑͔ͩΒςετ͢Δͱ͜Ζ ͍΍ʔཧ۶Ͱ͸େৎ෉ͳΜͰ͚͢Ͳɺ Կ͕ى͖Δ͔Θ͔Βͳ͍ͷͰͪΐͬͱ... ࡉ͔͘ௐ΂ͯΈͳ͍ͱͳΜͱ΋...

Slide 45

Slide 45 text

͋Δཧ༝Ͱมߋͨ͠ͱ͜Ζ...?? ࠓճ͸มߋ͠ͳ͔ͬͨͱ͜Ζ...?? ৺഑͔ͩΒςετ͢Δͱ͜Ζ

Slide 46

Slide 46 text

ؔ܎ͳ͍͸ͣͷίʔυ·Ͱ ௐ΂ͨΓςετͨ͠Γ͢Δ → ։ൃ଎౓͕௿Լ͢Δ

Slide 47

Slide 47 text

มߋͷཧ༝͕ҧ͏ͱมߋ͕ಉ࣌ൃੜ͢Δ Մೳੑ΋্͕Γɺௐ੔΍Ϛʔδ͕ෳࡶԽ͢Δ → ։ൃ଎౓͕௿Լ͢Δ

Slide 48

Slide 48 text

ςετ͢Δͱ͜Ζ ͋Δཧ༝Ͱมߋ͢Δͱ͜Ζ ࠓճ͸มߋ͠ͳ͍ͱ͜Ζ ͕͢͞ʹେৎ෉Ͱ͠ΐ

Slide 49

Slide 49 text

υϝΠϯΫϥεͷߏ଄ͱ DB ͷσʔλߏ଄Λ෼͚Δ

Slide 50

Slide 50 text

εςʔλε ( Int ) status 1 2 3 1 // ਃࠐத 2 // ར༻த 3 // ୀձࡁ // ར༻தͷ৔߹ if user.status == 2 { ... }

Slide 51

Slide 51 text

εςʔλε ୀձਃࠐ೔ 1 2 2 2023/09/08 3 2023/09/01 ୀձॲཧத͸ه࿥͸͚͍͍͚ͭͯͲίʔεมߋ͸Ͱ͖ͳ͍ͨ͘͠ ୀձॲཧத... 2 ͷ͏ͪୀձਃࠐ೔͕ຒ·ͬͯΔਓͬͯ͜ͱ͔...

Slide 52

Slide 52 text

εςʔλε ( Int ) 1 // ਃࠐத 2 // ར༻த 3 // ୀձࡁ // ར༻தͷ৔߹ if user.status == 2 && user.date != null { ... } εςʔλε ୀձਃࠐ೔ 1 2 2 2023/09/08 3 2023/09/01

Slide 53

Slide 53 text

εςʔλε ( Int ) 1 // ਃࠐத 2 // ར༻த 3 // ୀձࡁ // ར༻தͷ৔߹ if user.status == 2 && user.date != null { ... } εςʔλε ୀձਃࠐ೔ 1 2 2 2023/09/08 3 2023/09/01 ͏ͦ͡ΌΜʂ

Slide 54

Slide 54 text

ྫ͑͹ΤσΟλͰΫϥεͷߏ଄Λ ϦϑΝΫλϦϯάͨ͠ͱ͖ʹɺ DB ϚΠάϨʔγϣϯ͸·ͣ͠ͳ͍ υϝΠϯͷߏ଄ͱ DB ͷσʔλߏ଄͸ઈରʹ࿈ಈ͠ͳ͍

Slide 55

Slide 55 text

ͣΕ͍ͯ͘΋ͷΛ෼͚͍ͯͳ͍ͱࣄނ͕ى͖Δ ฉ͍ͯͨ࿩ͱಡΜͩίʔυ͕ҧ͏ͷͰށ࿭͏ → ։ൃ଎౓͕௿Լ͢Δ

Slide 56

Slide 56 text

εςʔλε ( Enum ) ਃࠐத ར༻த ୀձॲཧத ୀձࡁ // ར༻தͷ৔߹ if user.status.ར༻த { ... } εςʔλε ୀձਃࠐ೔ 1 2 2 2023/09/08 3 2023/09/01

Slide 57

Slide 57 text

ύοέʔδਤΛ֬ೝ

Slide 58

Slide 58 text

ͦΕҎ֎ Domain ίʔυ ίʔυ DB ͷߏ଄ͱ͸੾Γ཭͓ͯ͘͠

Slide 59

Slide 59 text

υϝΠϯΫϥεΛ࡞ͬͨΒ खଓ͖ͱ DB ૢ࡞Λ෼͚Δ

Slide 60

Slide 60 text

υϝΠϯΫϥεΛ࢖͏ खଓ͖ͷίʔυ͸ઈରʹඞཁ

Slide 61

Slide 61 text

΋͜͠ͷखଓ͖ͷίʔυʹ σʔλϕʔεͷॲཧ͕͍ࠞͬͯͨ͡Β

Slide 62

Slide 62 text

DPOODSFBUF$POOFDUJPO σʔλDPOORVFSZ TFMFDUGSPNSFDPSETXIFSF ̏৯෼ͷ৯ࣄه࿥OFX̏৯෼ͷ৯ࣄه࿥σʔλ OFX৯ࣄه࿥σʔλ σʔλ<>JE σʔλ<>EBUF σʔλ<>DBMPSJF OFX৯ࣄه࿥σʔλ σʔλ<>JE σʔλ<>EBUF σʔλ<>DBMPSJF OFX৯ࣄه࿥σʔλ σʔλ<>JE σʔλ<>EBUF σʔλ<>DBMPSJF ΞυόΠεOFXΞυόΠε DPOORVFSZ TFMFDUGSPNSFDPSETXIFSF <>JE JG̏৯෼ͷ৯ࣄه࿥શͯೖྗࡁ \ ΞυόΠεදࣔղې ^ DPOOFYFDVUF VQEBUFBEWJDFTFUTUBUVT XIFSFJE ΞυόΠεTUBUVT ΞυόΠεJE

Slide 63

Slide 63 text

DPOODSFBUF$POOFDUJPO σʔλDPOORVFSZ TFMFDUGSPNSFDPSETXIFSF ̏৯෼ͷ৯ࣄه࿥OFX̏৯෼ͷ৯ࣄه࿥σʔλ OFX৯ࣄه࿥σʔλ σʔλ<>JE σʔλ<>EBUF σʔλ<>DBMPSJF OFX৯ࣄه࿥σʔλ σʔλ<>JE σʔλ<>EBUF σʔλ<>DBMPSJF OFX৯ࣄه࿥σʔλ σʔλ<>JE σʔλ<>EBUF σʔλ<>DBMPSJF ΞυόΠεOFXΞυόΠε DPOORVFSZ TFMFDUGSPNSFDPSETXIFSF <>JE JG̏৯෼ͷ৯ࣄه࿥શͯೖྗࡁ \ ΞυόΠεදࣔղې ^ DPOOFYFDVUF VQEBUFBEWJDFTFUTUBUVT XIFSFJE ΞυόΠεTUBUVT ΞυόΠεJE ɹυϝΠϯΛ࢖͏ͨΊͷίʔυͳͷʹ ɹυϝΠϯ࢖ͬͯΔͷ͚ͩ͜͜

Slide 64

Slide 64 text

൥ࡶ

Slide 65

Slide 65 text

ύοͱݟͯυϝΠϯ͕ຒ΋Ε͍ͯΔͱ ʮ͜ͷ API ͳΜ͚ͩͬʯͱͳΔ → ։ൃ଎౓͕௿Լ͢Δ

Slide 66

Slide 66 text

υϝΠϯΛ࢖͏खଓ͖ͷ෦෼Λ UseCase ͱ͠ɺ ϞσϧΛಡΈॻ͖͢Δ෦෼Λ Repository ͱ͢Δ

Slide 67

Slide 67 text

̏৯෼ͷ৯ࣄه࿥৯ࣄ3FQPTJUPSZGJOE ΞυόΠεΞυόΠε3FQPTJUPSZGJOE JG̏৯෼ͷ৯ࣄه࿥શͯೖྗࡁ \ ΞυόΠεදࣔղې ^ ΞυόΠε3FQPTJUPSZVQEBUF ΞυόΠε

Slide 68

Slide 68 text

ύοέʔδਤʹ൓ө

Slide 69

Slide 69 text

ͦΕҎ֎ Domain Repository UseCase ίʔυ ίʔυ

Slide 70

Slide 70 text

ͳͥυϝΠϯ ( खଓ͖ ) ͱ DB ʹண໨͔ͨ͠

Slide 71

Slide 71 text

ͦΕҎ֎ Domain ίʔυ ίʔυ ɾϏδωεͷͨΊͷίʔυ ɾυϝΠϯΛ࿈ܞͤ͞ΔͨΊͷίʔυ ɾHTTP ϦΫΤετͷͨΊͷίʔυ ɾσʔλϕʔεಡΈॻ͖ͷͨΊͷίʔυ มߋ͞ΕΔൣғͱཧ༝͕ҧ͏͔Β ɹɾ༗ྉձһઐ༻ͷίʔε૿΍͍ͨ͠

Slide 72

Slide 72 text

ͦΕҎ֎ Domain ίʔυ ίʔυ ɾϏδωεͷͨΊͷίʔυ ɾυϝΠϯΛ࿈ܞͤ͞ΔͨΊͷίʔυ ɾHTTP ϦΫΤετͷͨΊͷίʔυ ɾσʔλϕʔεಡΈॻ͖ͷͨΊͷίʔυ มߋ͞ΕΔൣғͱཧ༝͕ҧ͏͔Β ɹɾੑೳϠό͘ͳ͖͔ͬͯͨΒඇਖ਼نԽ͢Δ

Slide 73

Slide 73 text

΋͏Ұ੠

Slide 74

Slide 74 text

ͦΕҎ֎ Domain Repository UseCase ίʔυ ίʔυ ϏδωεͷͨΊͷίʔυ υϝΠϯΛ࢖͏ίʔυ σʔλϕʔεͷͨΊͷίʔυ ·ͩࠞͬͯ͡ΔΑͶ

Slide 75

Slide 75 text

खଓ͖ͱ DB ͸ ࠜຊ͔Β෼͚Α͏

Slide 76

Slide 76 text

खଓ͖Λ੹຿ͱ͢Δ ύοέʔδΛ Application ͱ͢Δ

Slide 77

Slide 77 text

σʔλϕʔεΛ੹຿ͱ͢Δ ύοέʔδΛ Infrastructure ͱ͢Δ

Slide 78

Slide 78 text

ύοέʔδਤʹ൓ө

Slide 79

Slide 79 text

ͦΕҎ֎ Application Domain Repository UseCase ίʔυ Interface Class ίʔυ Infrastructure RepositoryImpl

Slide 80

Slide 80 text

Application Domain Repository UseCase Interface Class ίʔυ Infrastructure RepositoryImpl ɾORM Λ import ͨ͠Γ ɾ؀ڥม਺ͰڍಈΛม͑ͨΓ ɾϏδωεϧʔϧͷྲྀΕΛ஌Δ࣌ʹݟΔ ɾԿΛಡΈॻ͖͢Δ͔͸खଓ͖ͷҰ؀

Slide 81

Slide 81 text

ͱ͜ΖͰ Repository ͕ѻ͏ͷ͸Կ͔

Slide 82

Slide 82 text

Repository ͸ू໿͚ͩѻ͏ ※ ू໿ ϥΠϑαΠΫϧΛ࣋ͭ ( = ߋ৽͞Ε͍ͯ͘ ) ΦϒδΣΫτΛ ߋ৽͕࿈ಈ͢ΔൣғͰෆ੔߹͕ͳ͍Α͏ʹͱΓ·ͱΊͨ΋ͷ

Slide 83

Slide 83 text

΋͠ Repository ͕ू໿Ͱ͸ ͳͨͩ͘ͷΦϒδΣΫτΛѻ͏ͱ

Slide 84

Slide 84 text

GVO͋Δखଓ͖\ ே৯৯ࣄ3FQPTJUPSZGJOE̍৯෼ ன৯৯ࣄ3FQPTJUPSZGJOE̍৯෼ ༦৯৯ࣄ3FQPTJUPSZGJOE̍৯෼ ̏৯෼ͷ৯ࣄه࿥OFX̏৯෼ͷ৯ࣄه࿥ ே৯ ன৯ ༦৯ ே৯ӫཆૉன৯ӫཆૉ༦৯ӫཆૉ ^ ͜Ε͸ΦϒδΣΫτ ͜Ε͕ू໿

Slide 85

Slide 85 text

GVO͋Δखଓ͖\ ே৯৯ࣄ3FQPTJUPSZGJOE̍৯෼ ன৯৯ࣄ3FQPTJUPSZGJOE̍৯෼ ༦৯৯ࣄ3FQPTJUPSZGJOE̍৯෼ ̏৯෼ͷ৯ࣄه࿥OFX̏৯෼ͷ৯ࣄه࿥ ே৯ ன৯ ༦৯ ே৯ӫཆૉன৯ӫཆૉ༦৯ӫཆૉ ^ ू໿Λ૊ΈཱͯΔ࣮૷Λखଓ͖ଆʹॻ͔ͳ͚Ε͹͍͚ͳ͍ ͜Εຖճॻ͘ͷ͠ΜͲ͍ΑͶ ίϯετϥΫλมΘͬͨΒԿϲॴมߋ͢Δ͜ͱʹͳΔ΍Β...

Slide 86

Slide 86 text

GVO͋Δखଓ͖\ ̏৯෼ͷ৯ࣄه࿥ன৯BEE ΞΠε ৯ࣄ3FQPTJUPSZVQEBUF ̏৯෼ͷ৯ࣄه࿥ன৯ ^ ΦϒδΣΫτ͚ͩอଘ

Slide 87

Slide 87 text

GVO͋Δखଓ͖\ ̏৯෼ͷ৯ࣄه࿥ன৯BEE ΞΠε ৯ࣄ3FQPTJUPSZVQEBUF ̏৯෼ͷ৯ࣄه࿥ன৯ ^ ன৯͚ͩߋ৽͍ͯ͠Δ͚Ͳɺ ߹ܭӫཆૉ΋มΘͬͯΔ͔Βอଘ͠ͳ͍ͱ͍͚ͳ͍Α

Slide 88

Slide 88 text

ू໿ͷߏ଄Λ UseCase ʹ࿙Β͢ͱ ʮϧʔϧͷप஌పఈ͍ͨ΁Μʯ ʮू໿Λมߋͮ͠Β͍ʯͱͳΔ → ։ൃ଎౓͕௿Լ͢Δ

Slide 89

Slide 89 text

Repository ͸ू໿͚ͩѻ͏

Slide 90

Slide 90 text

GVO͋Δखଓ͖\ ̏৯෼ͷ৯ࣄه࿥3FQPTJUPSZGJOE ^ GVO͋Δखଓ͖\ ̏৯෼ͷ৯ࣄه࿥BEEன৯ ΞΠε ৯ࣄ3FQPTJUPSZVQEBUF ̏৯෼ͷ৯ࣄه࿥ ^ ू໿Λऔಘ ू໿Λมߋ ू໿Λอଘ

Slide 91

Slide 91 text

ύοέʔδਤʹ൓ө

Slide 92

Slide 92 text

ͦΕҎ֎ Application Domain ίʔυ Interface Class Infrastructure UseCase RepositoryImpl Repository ίʔυ ू໿

Slide 93

Slide 93 text

ͱ͜ΖͰɺ ू໿ͬͯੜ੒͕ͱͯ΋େม

Slide 94

Slide 94 text

ɾجຊతʹେ͖͍ ɾ͍ΖΜͳΦϒδΣΫτΛ࢖͏ ɾม׵΍Ϛοϐϯά͕͋Δ ɾෆ੔߹νΣοΫͷϧʔϧ͕͋Δ

Slide 95

Slide 95 text

ͦΕҎ֎ Application Domain ίʔυ Infrastructure Repository UseCase RepositoryImpl ू໿ ίʔυ ɹ͜͜ʹ new ू໿Λ ɹॻ͘͜ͱʹͳͬͯ͠·͏

Slide 96

Slide 96 text

ͦΕҎ֎ Application Domain ίʔυ Infrastructure Repository UseCase RepositoryImpl ू໿ ίʔυ ɹ͘Γ͔͑͠ॻ͖ͨ͘ͳ͍͠ɺ ɹͦ΋ͦ΋υϝΠϯϧʔϧͩ͠ɺ ɹnew ͸ͬͪ͜ʹॻ͍ͨΑͶ

Slide 97

Slide 97 text

ू໿ͷੜ੒͸ Domain ύοέʔδͷ Factory Ͱߦ͏

Slide 98

Slide 98 text

ύοέʔδਤʹ൓ө

Slide 99

Slide 99 text

ͦΕҎ֎ Application Domain ίʔυ Infrastructure Repository UseCase RepositoryImpl ू໿ ίʔυ Factory

Slide 100

Slide 100 text

Application Domain Infrastructure Repository UseCase RepositoryImpl ू໿ ίʔυ Factory खଓ͖ σʔλϕʔε ;Δ·͍ ੜ੒ɾ੔߹ੑϧʔϧ

Slide 101

Slide 101 text

Repository ͷಡΈͱॻ͖Λ෼͚Δ

Slide 102

Slide 102 text

ॻ͘୯ҐͱಡΉ୯Ґ͸ҧ͏

Slide 103

Slide 103 text

ॻ͘ͱ͖ ( ू໿ ) ৯ࣄه࿥ ৯ࣄه࿥ ৯ࣄه࿥ ɾछผ: ே৯ ɾ࣌ؒ: 08:30 ɾ৯ࣄ: ೲ౾ɺ͝൧ ɾӫཆૉ: λϯύΫ࣭... ࢷ࣭... ɾࣸਅ: ɾछผ: ன৯ ɾ࣌ؒ: 12:34 ɾ৯ࣄ: ਌ࢠကɺຯḩो ɾӫཆૉ: λϯύΫ࣭... ࢷ࣭... ɾࣸਅ: image.jpg ɾछผ: ༦৯ ɾ࣌ؒ: 19:51 ɾ৯ࣄ: ϋϯόʔάɺαϥμ ɾӫཆૉ: λϯύΫ࣭... ࢷ࣭... ɾࣸਅ: image.jpg ಡΉͱ͖ ( ू໿Ͱ͸ͳ͍͜ͱ͕͋Δ ) ̏৯෼ͷ৯ࣄ࣌ؒ ɾே৯ͷ࣌ؒ: 08:30 ɾன৯ͷ࣌ؒ: 12:34 ɾ༦৯ͷ࣌ؒ: 19:51

Slide 104

Slide 104 text

΋͠ Repository ʹಡΈॻ͖ ྆ํͷϝιουΛ࡞Δͱ

Slide 105

Slide 105 text

Α͘Θ͔Βͳ͍ϝιου͕૿͑Δ ৯ࣄه࿥ϦϙδτϦ\ GVOGJOE#Z*E *E ू໿ GVOJOTFSU ू໿ GVOVQEBUF ू໿ GVOGJOE#Z6TFS*E 6TFS*E ू໿ˡू໿ѻͬͯΔ͔ΒΪϦηʔϑ GVOFYJTUT *E #PPMˡ͜Ε͸ηʔϑ GVOHFU৯ࣄ࣌ؒϦετ *E -JTU5JNFˡू໿͸ GVOHFUன৯ *E ৯ࣄˡू໿ͷҰ෦Ͱ͔͠ͳ͍͚Ͳ GVOVQEBUF৯ࣄ࣌ؒ *E 5JNF ˡू໿࢖Θͳ͍ͷ ^ ϥΠϑαΠΫϧΛѻ͏ͷ͕ू໿Ͱɺ Repository ͷ੹຿͸ू໿ͷอଘͱ෮ݩͷ ͸͚ͣͩͲ... ͍ͭ͜Β͸...??

Slide 106

Slide 106 text

ͳΜͰ΋ SQL ॻ͍͍͍ͯͱ͜Ζ ʹͳͬͯ͠·͏

Slide 107

Slide 107 text

ू໿Λ௨ͣ͞ঢ়ଶΛѻ͍ͬͯΔͱ ʮ݁ہΫΤϦಡ·ͳ͍ͱΘ͔ΒΜʯͱͳΔ → ։ൃ଎౓͕௿Լ͢Δ

Slide 108

Slide 108 text

Ͱ͸ Repository ʹू໿ΛಡΈॻ͖ ͢Δϝιου͔͠࡞Βͳ͍ͱ

Slide 109

Slide 109 text

ੑೳతʹແବ͕ଟ͍ ̍೔લSFQPTJUPSZGJOE#Z*E ̎೔લSFQPTJUPSZGJOE#Z*E ̏೔લSFQPTJUPSZGJOE#Z*E ̏೔ؒͷ৯ࣄ࣌ؒϦετ<̍೔લ࣌ؒ ̎೔લ࣌ؒ ̏೔લ࣌ؒ> ɹू໿͕̏ͭඞཁͩͱ ɹ̏ճͷ DB ΞΫηε͕ඞཁ ɹ৯ࣄ΍ӫཆૉͷ৘ใΛ join ͯ͠ ɹ෮ݩͨ͠ͷʹɺ͔࣌ؒ͠࢖ͬͯͳ͍

Slide 110

Slide 110 text

ಡΉॲཧ͸ඞཁ͚ͩͲ Repository ʹॻ͘ͷ͸ͬ͘͠Γ͜ͳ͍

Slide 111

Slide 111 text

ू໿ͷอଘͱ෮ݩ͸ Repository ͱ͠ɺ ΄͔ͷॊೈͳࢀর͸ QueryService ͱ͢Δ

Slide 112

Slide 112 text

ύοέʔδਤʹ൓ө

Slide 113

Slide 113 text

ͦΕҎ֎ Application Domain ίʔυ Interface Class Infrastructure QueryService QueryServiceImpl Repository UseCase RepositoryImpl ू໿ ίʔυ Factory

Slide 114

Slide 114 text

৯ࣄه࿥3FQPTJUPSZ\ GVOGJOE#Z*E *E ू໿ GVOJOTFSU ू໿ GVOVQEBUF ू໿ ^ ৯ࣄه࿥2VFSZ4FSWJDF\ GVOFYJTUT *E #PPM GVOHFU৯ࣄ࣌ؒϦετ *E -JTU5JNF ^ ू໿ʹूத͢Δ ɹू໿Λ࢖Θͳ͍͜ͱ΋͋Δ ɹͨͩ͠ ಡΈ ͚ͩ

Slide 115

Slide 115 text

࢒ͬͨ෦෼͸֎քͱͷ૭ޱ

Slide 116

Slide 116 text

ͦΕҎ֎ Application Domain ίʔυ Interface Class Infrastructure ɹೖྗͷܻ਺νΣοΫ ɹϨεϙϯε Json ͷ࡞੒ ɹUseCase ͷ࣮ߦ QueryService QueryServiceImpl Repository UseCase RepositoryImpl ू໿ ίʔυ Factory

Slide 117

Slide 117 text

ɹϨεϙϯε Json ͷ࡞੒΍ UseCase ͷ࣮ߦ͸ API ݻ༗ͷ౎߹

Slide 118

Slide 118 text

ମॏΛ 10.0 ~ 200.0 ͷখ਺Ͱ ѻ͏ͷ͸γεςϜڞ௨ϧʔϧ

Slide 119

Slide 119 text

΋͠શͯͷ API Ͱମॏͷ όϦσʔγϣϯΛݸผ࣮૷͍ͯ͠Δͱ

Slide 120

Slide 120 text

API 1 ମॏνΣοΫ 1 API 2 ମॏνΣοΫ 2 API 3 ମॏνΣοΫ 3 API 4 ମॏνΣοΫ 4 ॏෳίʔυͷϝϯς͸Ҋ֎େม ্ݶΛ 210.0 ʹ͍ͨ͠ ͑ͬ

Slide 121

Slide 121 text

"ಉ͡" Λ࢓૊ΈͰ͸ͳ͓͘࡞๏Ͱ࣮ݱ͢Δͱ ʮมߋͭΒ͍ɺ֬ೝ͍ͨ΁ΜʯͱͳΔ → ։ൃ଎౓͕௿Լ͢Δ

Slide 122

Slide 122 text

ݻ༗ͷ౎߹͸ Controller ͱ͠ɺ ڞ௨ͷϧʔϧ͸ Request ͱͯ͠ɺ ෼͚ͯอक͠Α͏

Slide 123

Slide 123 text

ύοέʔδਤʹ൓ө

Slide 124

Slide 124 text

Presentation Application Infrastructure Domain Request Controller Interface Class ɹUseCase ͷ࣮ߦ ɹϨεϙϯε Json ͷ࡞੒ ɹೖྗͷܻ਺νΣοΫ QueryService QueryServiceImpl Repository UseCase RepositoryImpl ू໿ ίʔυ Factory

Slide 125

Slide 125 text

࠷ޙʹू໿ʹॻ͖ͮΒ͍ υϝΠϯϩδοΫʹ͍ͭͯ

Slide 126

Slide 126 text

৯ࣄه࿥ ͲͪΒͷू໿ʹॻ͔͘... Χϥμه࿥ ৯ࣄه࿥ͱΧϥμه࿥͔Βɺ݈߁౓ಘ఺Λࢉग़͢Δ ৯ࣄه࿥ಘ఺ܭࢉ Χϥμه࿥ Χϥμه࿥ಘ఺ܭࢉ ৯ࣄه࿥

Slide 127

Slide 127 text

ͲͪΒ͔ͷू໿ʹ࣮૷͢Δͱ

Slide 128

Slide 128 text

৯ࣄه࿥ มͳґଘ͕ൃੜ͢Δ Χϥμه࿥ ΋ͱ΋ͱؔ܎ͷͳ͍ 2 ͭͷू໿ʹґଘ͕ൃੜ͢Δ

Slide 129

Slide 129 text

৯ࣄه࿥ ֦ு͠ʹ͘͘ͳΔ Χϥμه࿥ ඞཁͳू໿͕૿͑ͨ࣌ʹΑΓࠔΔ ӡಈه࿥ ʁ ʁ

Slide 130

Slide 130 text

ෆඞཁͳू໿ͷґଘΛൃੜͤ͞Δͱ ʮू໿ͷมߋ͕ผͷू໿ʹӨڹ͢Δ͔Βม͑ʹ͍͘ʯ ʮू໿ͷؔ܎Λ஌Βͳ͍ͱॲཧΛݟ͚ͭΒΕͳ͍ʯ ͱͳΔ → ։ൃ଎౓͕௿Լ͢Δ

Slide 131

Slide 131 text

ू໿ʹ͓͞·Βͳ͍υϝΠϯॲཧ͸ DomainService ʹ࣮૷͢Δ

Slide 132

Slide 132 text

৯ࣄه࿥ Χϥμه࿥ υϝΠϯαʔϏε υϝΠϯαʔϏεಘ఺ܭࢉ ৯ࣄه࿥ Χϥμه࿥

Slide 133

Slide 133 text

৯ࣄه࿥ Χϥμه࿥ υϝΠϯαʔϏε ू໿͸ಠཱ͍ͯ͠Δ υϝΠϯαʔϏεHFU݈߁౓ಘ఺ ৯ࣄه࿥ Χϥμه࿥

Slide 134

Slide 134 text

৯ࣄه࿥ ӡಈه࿥ υϝΠϯαʔϏεHFU݈߁౓ಘ఺ ৯ࣄه࿥ Χϥμه࿥ ӡಈه࿥ υϝΠϯαʔϏε Χϥμه࿥ ֦ு͠΍͍͢

Slide 135

Slide 135 text

ύοέʔδਤʹ൓ө

Slide 136

Slide 136 text

Presentation Application Infrastructure Domain Request Controller Factory DomainService ू໿ Interface Class QueryService QueryServiceImpl Repository UseCase RepositoryImpl

Slide 137

Slide 137 text

໨త͸Ռͨͤͦ͏͔

Slide 138

Slide 138 text

Կͱ࿈ಈ͍ͯ͠Δ͔

Slide 139

Slide 139 text

Presentation Infrastructure Application Domain

Slide 140

Slide 140 text

Presentation Infrastructure Application Domain ֓೦Ϟσϧਤ ৽ίʔε࡞Γ͍ͨ Ϣʔεέʔε Ϋϥεਤ Ϣʔεέʔεهड़ Ϗδωεؔ܎ͷίʔυ͸...

Slide 141

Slide 141 text

Presentation Infrastructure Application Domain DB ࢓༷ॻ ςʔϒϧߏ଄ม͍͑ͨ DB ؔ܎ͷίʔυ͸...

Slide 142

Slide 142 text

Presentation Infrastructure Application Domain API ࢓༷ॻ ΞϓϦͷදࣔม͍͑ͨ ֎քؔ܎ͷίʔυ͸...

Slide 143

Slide 143 text

଎͘։ൃͰ͖Δ͔

Slide 144

Slide 144 text

Presentation Application Infrastructure Domain QueryService QueryServiceImpl Repository UseCase Request Controller RepositoryImpl Factory DomainService ू໿ ಘ఺ܭࢉϧʔϧ͕มΘͬͨ σʔλߏ଄΋ॲཧϑϩʔ΋ มΘΒͳ͍ͳΒରԠ͸͚ͩ͜͜ Ͱେৎ෉ ࣗಈςετʹ DB ΋͍Βͳ͍

Slide 145

Slide 145 text

Presentation Application Infrastructure Domain QueryService QueryServiceImpl Repository UseCase Request Controller RepositoryImpl Factory DomainService ू໿ ςʔϒϧఆٛม͑ͨ Infrastructure ͷࣗಈςετ ͕௨ͤΕ͹େৎ෉ Application ͷ Interface ͕ มߋͳ͠ͳΒଞʹӨڹͳ͠

Slide 146

Slide 146 text

Presentation Application Infrastructure Domain QueryService QueryServiceImpl Repository UseCase Request Controller RepositoryImpl Factory DomainService ू໿ ϑϩʔͳΒ Application Λ֬ೝ UseCase ͷࣗಈςετΛ͚ͨ͠ Ε͹ Infrastructure ͸ϞοΫͰ े෼ ༗ྉձһͷϑϩʔΛม͍͑ͨ

Slide 147

Slide 147 text

Presentation Application Infrastructure Domain QueryService QueryServiceImpl Repository UseCase Request Controller RepositoryImpl Factory DomainService ू໿ ࢀর࣌ʹ਎௕΋ฦͯ͠ ࢀর৘ใ͸ QueryService Λ த৺ʹରԠ͢Ε͹ OK

Slide 148

Slide 148 text

มߋͷछྨʹԠͯ͡ ʮ୭ͱԿΛݟͯ࿩͔͢ʯ ʮͲ͜Λมߋ͢Δඞཁ͕͋Δ͔ʯ ͕໌֬ʹͳΔ

Slide 149

Slide 149 text

υϝΠϯ஌ࣝΛڞ༗ͯ͠ υϝΠϯΫϥεΛߋ৽͠ଓ͚ΒΕΔ

Slide 150

Slide 150 text

υϝΠϯʹ͍ͭͯ ߟ͑Δ͕࣌ؒ૿΍ͤΔ

Slide 151

Slide 151 text

ϦΞʔΩςΫνϟʹΑͬͯ ͜͏ͳΓ͍ͨ

Slide 152

Slide 152 text

͜͏͍͏෩ʹߟ͑ͳ͕Β Ұॹʹ։ൃͤͯ͞΋Β͍ͬͯ·͢