Slide 1

Slide 1 text

ݪాਅޗ 1)1ΤϯδχΞʹΑΔ4DBMBΤϯδ χΞ΁ͷస਎ͱͦͷखҾ͖ 4DBMBؔ੢4VNNJU

Slide 2

Slide 2 text

2017/11/11 © ChatWork All rights reserved. 2 ࣗݾ঺հ ‣ $IBU8PSLגࣜձࣾαʔόʔαΠυ։ൃ෦ ‣ ೖࣾ ݱࡏͰஸ౓೥͙Β͍ ‣ 1)1ΤϯδχΞͱͯ͠ೖࣾ ‣ ࠷ۙ4DBMBϓϩμΫτʹ΋KPJO 4DBMBྺϲ݄͙Β͍ɺ +BWBະܦݧ

Slide 3

Slide 3 text

2017/11/11 © ChatWork All rights reserved. 3 $IBU8PSLʹ͍ͭͯ ‣ ϏδωενϟοταʔϏε ‣ λεΫ؅ཧɾϏσΦ௨࿩ ‣ ಋೖاۀ ࣾҎ্

Slide 4

Slide 4 text

2017/11/11 © ChatWork All rights reserved. 4 5PQJDT ‣ $IBU8PSLͰͷ4DBMBͷऔΓ૊Έ ‣ 4DBMBϓϩμΫτ΁ͷࢀՃɻֶशͷ͖᪴ͱղܾํ๏ ‣ 4DBMBΤϯδχΞʹస਎ͯ͠Έͨ݁Ռ

Slide 5

Slide 5 text

2017/11/11 © ChatWork All rights reserved. 5 $IBU8PSLͱ4DBMBͷؔ܎ɾ։ൃܦҢ

Slide 6

Slide 6 text

2017/11/11 © ChatWork All rights reserved. 6 1)1։ൃ͔Β4DBMB։ൃ΁ ‣ ೥ࠒ͔Β1)1͚ͩͰͳ͘4DBMBϓϩμΫτ΋։ൃ ‣ 4DBMBϓϩμΫτͷ૿Ճ ‣ 0"VUI ‣ 8FCIPPL ‣ #PY࿈ܞ ‣ *'555࿈ܞ

Slide 7

Slide 7 text

2017/11/11 © ChatWork All rights reserved. 7 $IBU8PSLͱ4DBMBͷؔ܎ ‣ $IBU8PSLͷ4DBMB࠾༻ϓϩμΫτl'BMDPOzϦϦʔε·Ͱͷࣦഊͱ ੒ޭͷྺ࢙ 4DBMB.BUTVSJ w IUUQTTQFBLFSEFDLDPNKJLPIJTUPSZPGGBMDPOUIFXBZUPQSPEVDUJPOSFMFBTF ‣ $IBU8PSLͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ "84%FW %BZ5PLZP w IUUQTTQFBLFSEFDLDPNKJLPDIBUXPSLGBMTFYJONFUVTF[JOHVTJTVUFNVXP[IJ FSVKJTIV ‣ 4DBMBBOE"LLBBQQTPO,VCFSOFUFTJO$IBU8PSL 4DBMBؔ੢ 4VNNJU w IUUQTTQFBLFSEFDLDPNIBZBTTIJTDBMBBOEBLLBBQQTPOLVCFSOFUFTJO DIBUXPSL

Slide 8

Slide 8 text

2017/11/11 © ChatWork All rights reserved. 8 4DBMBϓϩμΫτ΁ͷࢀՃ ֶशͷ͖᪴ͱղܾ๏

Slide 9

Slide 9 text

2017/11/11 © ChatWork All rights reserved. 9 4DBMBϓϩδΣΫτͰ࢖ΘΕ͍ͯͨ஌ࣝ ͱֶशঢ়گ ‣ ࢖ΘΕ͍ͯͨϥΠϒϥϦͱݴޠͷဃ཭ w TDBMB[ "LLB LBNPO DJSDF FUDʜ ‣ ࠓ·Ͱܦݧͨ͠ϓϩάϥϛϯάݴޠ w 1)1ɺ1ZUIPOɺ$ʜ

Slide 10

Slide 10 text

2017/11/11 © ChatWork All rights reserved. 10 1)1ˠ4DBMBֶशͷ݁Ռ

Slide 11

Slide 11 text

2017/11/11 © ChatWork All rights reserved. 11 *'555࿈ܞΛ4DBMBͰ։ൃˍϦϦʔε ‣ ࢖༻ͯ͠ΔϥΠϒϥϦ w "LLB)UUQ w "LLB4USFBN w TDBMB[ w DJSDF w FUD

Slide 12

Slide 12 text

2017/11/11 © ChatWork All rights reserved. 12 *'555࿈ܞ ެࣜυΩϡϝϯτ IUUQTQMBUGPSNJGUUUDPNEPDT

Slide 13

Slide 13 text

2017/11/11 © ChatWork All rights reserved. 13 4DBMBϓϩμΫτʹࢀՃ

Slide 14

Slide 14 text

2017/11/11 © ChatWork All rights reserved. 14 େ͖ͳน ϓϩμΫτίʔυͱ஌ࣝͷဃ཭ def create(implicit scheduler: Scheduler): Flow[CreateUserAccountRequest, CreateUserAccountResponse, NotUsed] = Flow[CreateUserAccountRequest].mapAsync(1) { userAccount => (for { id <- userIdGenerator.generateId() result <- userRepository.store( UserAccount( id, Status.Active, EmailAddress(userAccount.emailAddress), HashedPassword(userAccount.password), userAccount.firstName, userAccount.lastName, Clock.now, None ) ) } yield CreateUserAccountResponse(id.value)).runAsync }

Slide 15

Slide 15 text

2017/11/11 © ChatWork All rights reserved. 15 େ͖ͳน ϓϩμΫτίʔυͱ஌ࣝͷဃ཭ def create(implicit scheduler: Scheduler): Flow[CreateUserAccountRequest, CreateUserAccountResponse, NotUsed] = Flow[CreateUserAccountRequest].mapAsync(1) { userAccount => (for { id <- userIdGenerator.generateId() result <- userRepository.store( UserAccount( id, Status.Active, EmailAddress(userAccount.emailAddress), HashedPassword(userAccount.password), userAccount.firstName, userAccount.lastName, Clock.now, None ) ) } yield CreateUserAccountResponse(id.value)).runAsync }

Slide 16

Slide 16 text

2017/11/11 © ChatWork All rights reserved. 16 ͳͥ೉͘͠ײͨ͡ͷ͔ ‣ 4DBMB͓Αͼؔ਺ܕݴޠʹ׳Ε͍ͯͳ͍ w লུه๏ɺߴ֊ؔ਺ɺ҉໧ͷύϥϝʔλɺΧϦʔԽɺFUDʜ ‣ +BWBपΓͷ஌ࣝ ‣ ετϦʔϛϯάɺฒߦॲཧʹؔ͢Δ஌ࣝ

Slide 17

Slide 17 text

2017/11/11 © ChatWork All rights reserved. 17 1)1ͱ4DBMBͷൺֱ 1)1 4DBMB ܕ෇͚ ಈత ੩త ϓϩάϥϜύϥμΠϜ खଓ͖ܕ ΦϒδΣΫτࢦ޲ ؔ਺ܕ ΦϒδΣΫτࢦ޲ ӨڹΛड͚ͨݴޠ 1FSM $ +BWB IUUQTKBXJLJQFEJBPSHXJLJϓϩάϥϛϯάݴޠͷൺֱ

Slide 18

Slide 18 text

2017/11/11 © ChatWork All rights reserved. 18 ྫ ؔ਺ͷهड़ελΠϧ͕ෳ਺͋Δ // ܕΞϊςʔγϣϯΛ࢖͏ val toInt: (String => Int) = (s: String) => s.toInt // ܕΞϊςʔγϣϯΛলུ((Ҿ਺) => ຊମ) val toInt2 = (s: String) => s.toInt // ϓϨʔεϗϧμʔΛ࢖༻ͨ͠ܗ val toInt3: (String => Int) = _.toInt w FY TUSJOHΛҾ਺ʹͱͬͯɺJOUʹมߋ͢Δؔ਺ͷهड़ελΠϧʹͯ͠΋਺ύλʔϯ͋ΔΑ͏ ʹࢥ͑ͨ w 1)1ͷ৔߹ w 4DBMBͷ৔߹ $toInt = function(string $s) {return (int)$s;}; ‣ ࢀߟ w IUUQTHJTUHJUIVCDPNHBLV[[[[ w IUUQTRJJUBDPNOFTIFFQJUFNTBFDFFGEG

Slide 19

Slide 19 text

2017/11/11 © ChatWork All rights reserved. 19 ྫ ؔ਺ܕ ‣ FY UP·Ͱͷ੔਺Ͱۮ਺ͷ΋ͷ͚ͩ ح਺͸আ͘ Λഒͯ͠ɺ ͦͷ૯࿨ΛٻΊΔ w 1)1ͷ৔߹ // ᶃarray_**ܥͷؔ਺Λ࢖ͬͨ৔߹ $result = array_sum(
 array_map( function ($i) {
 return $i * 10;
 },
 array_filter(range(1, 10), function ($i) {
 return ($i % 2 === 0);
 })
 )
 ); // ᶄ݁ہ͜͏ͳΓͦ͏
 $result = 0;
 foreach (range(1, 10) as $int) {
 if ($int % 2 === 0) {
 $result += $int * 10;
 }
 }

Slide 20

Slide 20 text

2017/11/11 © ChatWork All rights reserved. 20 ྫ ؔ਺ܕ def stringMatching(matcher: (String) => Boolean) = matcher("sample text") def stringStart(query: String) = stringMatching(_.startsWith(query)) // ҎԼͱಉٛ // strMatching((str: String) => str.startsWith(query)) def stringContain(query: String) = stringMatching(_.contains(query)) ‣ 4DBMBͷ৔߹ ϫϯϥΠφʔͰهड़Մೳ ‣ ଞͷྫɿ4USJOHΛҾ਺ʹͱΓɺCPPMFBOΛฦؔ͢਺Λ౉͢ (1 to 10).withFilter(_ % 2 == 0).map(_ * 10).sum

Slide 21

Slide 21 text

2017/11/11 © ChatWork All rights reserved. 21 +BWBपΓͷ஌ࣝ ‣ OVMM΁ͷߟྀ w /VMM1PJOUFS&YDFQUJPO͕ൃੜͯ͠͠·͏ w SFUVSOWBMVFPSOVMMͷ+BWBϝιουΛݺͼग़࣌͢ʹ͸0QUJPOBQQMZͰғͬͯ͋ ͛Δ ‣ +BWBϥΠϒϥϦɺύοέʔδͷཧղ w MPHCBDLɺKBWBYDSZQUP w εϨουϓʔϧͷ෼ׂ ‣ FUDʜ akka { dispatcher { type = Dispatcher executor = "thread-pool-executor" thread-pool-executor { fixed-pool-size = 32 } throughput = 1 } }

Slide 22

Slide 22 text

2017/11/11 © ChatWork All rights reserved. 22 ղܾํ๏ ‣ ஈ֊తʹֶΜͰ͍͘ Ұ౓ʹଟ͘ͷ͜ͱΛֶ͹ͳ͍ ‣ ݱঢ়ࠔ೉ͱͳΔཁҼΛ෼ׂͯ͠ ̍ͭͣͭ ֶͿ w ؔ਺ܕݴޠ w "LLBTUSFBN w +BWBͷ஌ࣝ w FUDʜ

Slide 23

Slide 23 text

2017/11/11 © ChatWork All rights reserved. 23 ॻ੶ɾXFC ڭࡐͰֶश ‣ ݴޠ࢓༷ɺؔ਺ܕ΍ετϦʔϜͷ֓೦ͳͲΛॏ఺తʹֶश ‣ XFC্Ͱͷ৘ใ w 4DBMBશൠ w IUUQTEXBOHPHJUIVCJPTDBMB@UFYU w IUUQTHJUIVCDPNIBUFOB)BUFOB5FYUCPPLCMPCNBTUFS GPVOEBUJPOPGQSPHSBNNJOHTDBMBNE w "LLB4USFBN w IUUQTUIJOLJUDPKQBSUJDMF

Slide 24

Slide 24 text

2017/11/11 © ChatWork All rights reserved. 24 4DBMB ࣾ಺ڭࡐͷ׆༻ ‣ ԋश՝୊Ͱ࣮ࡍʹखΛಈֶ͔ͭͭ͠श

Slide 25

Slide 25 text

2017/11/11 © ChatWork All rights reserved. 25 ࣾ಺ͷϦιʔεΛ׆༻͢Δ ‣ ༗ࣝऀʹώΞϦϯάˍϖΞϓϩ ‣ 4DBMBઐ༻νϟοτ 4DBMB෦ ͷ׆༻

Slide 26

Slide 26 text

2017/11/11 © ChatWork All rights reserved. 26 श࡞ͰຒΊΔ ‣ ΑΓ࣮ફతͳ಺༰ͰϓϩμΫτίʔυͱͷࠩ෼ΛঃʑʹຒΊΔ ‣ श࡞ ՝୊ͷ࣮ࢪ w 4DBMB ࣾ಺ڭࡐ w FY 1MBZ'SBNFXPSLͷԋश՝୊ w "LLB (SBQI4UBHFΛ࢖༻ͯ͠ϑΝΠϧˠ%#΁ͷ؆୯ͳॲཧ w SBNMQBSTFSͷ࡞੒ w FUD ‣ ϥΠϒϥϦ࡞੒ˍΞϓϦέʔγϣϯ։ൃ

Slide 27

Slide 27 text

2017/11/11 © ChatWork All rights reserved. 27 ஈ֊Λ౿ΜͰ੒Ռ෺ͷϦϦʔε ੒Ռ෺ϦϦʔε श࡞՝୊ 4DBMB ݴޠֶश ϓϩμΫτࢀՃ ࣌ܥྻ

Slide 28

Slide 28 text

2017/11/11 © ChatWork All rights reserved. 28 4DBMB։ൃͷײ૝ ‣ ੩తܕɺؔ਺ܕͷԸܙ w 1)1Ͱ͸ػೳ௥ՃʹΑΔςετ΍֬ೝ࡞ۀ͕େม Өڹൣғ͕ݟ͑ʹ͍͘ w ϞσϦϯάɺϦϑΝΫλ͠΍͍͢ ‣ ֶश͕ਐΉʹͭΕརศੑΛ࣮ײ w ঺հग़དྷͳ͔͚ͬͨͲ NBUDIDBTF 'VUVSFɺ&JUIFSɺ0QUJPOɺFUDʜ ‣ +BWBͷ๛෋ͳࢿ࢈Λ׆༻Ͱ͖Δ

Slide 29

Slide 29 text

2017/11/11 © ChatWork All rights reserved. 29 ·ͱΊ ‣ 4DBMBΛֶश͔Βೖͬͯ։ൃग़དྷΔ؀ڥ͕͋Δ ‣ ΩϟονΞοϓɺ੒௕ग़དྷΔ؀ڥ͕͋Δ ‣ ʮֶशʯˠʮश࡞ʯˠʮϓϩμΫτʯͱ͍ͬͨΑ͏ʹஈ֊Λ౿Ή͜ ͱ͕Ͱ͖ͨ ‣ ඼࣭͕୲อ͞Εอकɾӡ༻͕͠΍͘͢ͳΔ ‣ ৽ͨͳߟ͑ΛऔΓೖΕΒΕΔ ‣ ੩తɺؔ਺ܕɺඇಉظɺฒߦϓϩάϥϛϯάɺFUDʜ

Slide 30

Slide 30 text

2017/11/11 © ChatWork All rights reserved. 30 ҰॹʹνϟοτϫʔΫΛྑ͍͖ͯͨ͘͠ ͍ΤϯδχΞͷํΛืूʂ IUUQTDPSQDIBUXPSLDPNKBSFDSVJUFOHJOFFS

Slide 31

Slide 31 text

2017/11/11 © ChatWork All rights reserved. 31 ͝ਗ਼ௌ͋Γ͕ͱ͏ޚ࠲͍·ͨ͠