1400万ユーザーのWebサービスを 15年運用して考える、
Javaである理由

1400万ユーザーのWebサービスを 15年運用して考える、
Javaである理由

2d739f38514c90611f34e8f2b3473cdf?s=128

masaozi3

May 18, 2019
Tweet

Transcript

  1. ϑϦϡʔגࣜձࣾླ໦ਅੜ !NBTBP[Jʣ ສϢʔβʔͷ8FCαʔϏεΛ ೥ӡ༻ͯ͠ߟ͑Δɺ
 +BWBͰ͋Δཧ༝

  2. w ϑϦϡʔגࣜձࣾ!ژ౎ w ࣾձਓྺ΋+BWBྺ΋೥໨ w +BWBͱ4QSJOHͰz(*3-4Λ)"11:ʹz͢Δ࢓ࣄΛ͍ͯ͠·͢ w େֶ࣌୅͸1ZUIPOͰ8FCΞϓϦΛ։ൃ ޷͖ͳ΋ͷ ษڧձͷελοϑɺϊϕϧςΟͷൃ஫ɺ͓͍͍͓͠ञ


    ϔΞΧϥʔϒϦʔνɺ୐഑ͷ഑ૹঢ়گΛோΊΔ ླ໦ਅੜ !NBTBP[J !2 ʘ·͓͞Ͱ͢ʗ w w w
  3. w ࠓ೔ͷΰʔϧ w ࿩ͷ͖͔͚ͬ w ฐࣾͷαʔϏεͱٕज़બ୒ͷ࿩ w ೔ʑͷӡ༻͔ΒΈΔ+BWBͰ͋Δཧ༝ w ʲ͓·͚ʳ+%,ͷҠߦͷ࿩

    w ݁࿦ w ͓͠Βͤ ࠓ೔࿩͢͜ͱ !3 ੩͔ʙʹฉ͘ΑΓ΋
 ΘʔΘʔݴ͍ͳ͕Β
 ฉ͍ͯ΋Β͑Ε͹خ͍͠Ͱ͢ʂ
  4. w ࠓ೔ͷΰʔϧ w ࿩ͷ͖͔͚ͬ w ฐࣾͷαʔϏεͱٕज़બ୒ͷ࿩ w ೔ʑͷӡ༻͔ΒΈΔ+BWBͰ͋Δཧ༝ w ʲ͓·͚ʳ+%,ͷҠߦͷ࿩

    w ݁࿦ w ͓͠Βͤ ࠓ೔࿩͢͜ͱ !4 ʮ೥ӡ༻ͯ͠ʯͱ͍͍ͭͭ
 ೥ϲ݄͔͠ݟͯͳ͍ͷͰ
 ௐ΂ͨ৘ใ΋͋Γ·͢
  5. ࠓ೔ͷΰʔϧ

  6. !6 ʮ+BWB͕దͨ͠αʔϏεͱ͸Կ͔ʯ ΁ͷҰͭͷղΛݟ͚ͭΔ͜ͱ

  7. ࿩ͷ͖͔͚ͬ

  8. w 4DBMB͕େ޷͖ͳઌഐ͕+BWBΛॻ͍͍ͯͯ೔ʑۤͦ͠͏Ͱ͋Δ w पғͷ༑ਓ͕ʮ+BWB͸ઈରॻ͖ͨ͘ͳ͍ʯͳͲݴ͍ͬͯͯɺ
 ͳΜ͔ͩ൵͍͠ w ͱ͸͍͑ࣗ෼΋+BWB͕͘͢͝޷͖ͱ͍͏Θ͚Ͱ͸ͳ͍ w ྡͷνʔϜ͸αʔόʔαΠυ,PUMJOΛݕ౼͍ͯ͠ΔΑ͏ͩʁ w

    ผͷݴޠΛݕ౼ͨ͜͠ͱ͸͋ΔΒ͍͠ɹɹɹɹɹͳͲͳͲ ࿩ͷ͖͔͚ͬ !8
  9. w 4DBMB͕େ޷͖ͳઌഐ͕೔ʑۤͦ͠͏Ͱ͋Δ w पғͷ༑ਓ͕ʮ+BWB͸ઈରॻ͖ͨ͘ͳ͍ʯͳͲݴ͍ͬͯͯɺͳΜ͔ͩ൵ ͍͠ w ͱ͸͍͑ࣗ෼΋+BWB͕͘͢͝޷͖ͱ͍͏Θ͚Ͱ͸ͳ͍ w ྡͷνʔϜ͸αʔόαΠυ,PUMJOΛݕ౼͍ͯ͠ΔΑ͏ͩʁ w

    ผͷݴޠΛݕ౼ͨ͜͠ͱ͸͋ΔΒ͍͠ ࿩ͷ͖͔͚ͬ !9 ͳΜͰ+BWBΛ࢖͍ͬͯΔΜͩΖ͏ʁ +BWB͕ద͍ͯ͠Δ΋ͷͬͯͳΜͩΖ͏ʁ ഑ଐ͞ΕͨϓϩμΫτ͕+BWB͔ͩͬͨΒ
 Ҏ֎ͷཧ༝͸ͳ͍ͷͩΖ͏͔ʁ
  10. w 4DBMB͕େ޷͖ͳઌഐ͕೔ʑۤͦ͠͏Ͱ͋Δ w पғͷ༑ਓ͕ʮ+BWB͸ઈରॻ͖ͨ͘ͳ͍ʯͳͲݴ͍ͬͯͯɺͳΜ͔ͩ൵ ͍͠ w ͱ͸͍͑ࣗ෼΋+BWB͕͘͢͝޷͖ͱ͍͏Θ͚Ͱ͸ͳ͍ w ྡͷνʔϜ͸αʔόαΠυ,PUMJOΛݕ౼͍ͯ͠ΔΑ͏ͩʁ w

    ผͷݴޠΛݕ౼ͨ͜͠ͱ͸͋ΔΒ͍͠ ࿩ͷ͖͔͚ͬ !10 ⾠ܾͯ͠ϚαΧϦΛ౤͛ʹདྷͨͷͰ͸ͳ͍Ͱ͢ ʮ࢖͏͔Βʹ͸ɺྑ͞Λ஌Γ͍ͨʯ Έͳ͞Μͷ+BWBΛબΜͩཧ༝΍
 +BWBͷ޷͖ͳͱ͜ΖͳͲ΋ͥͻฉ͖͍ͨͰ͢
  11. ฐࣾͷαʔϏεͱ
 ٕज़બ୒ͷ࿩

  12. w ϓϦըऔಘαʔϏε
 ϓϦϯτγʔϧػͰࡱӨͨ͠ը૾Λ
 εϚϗ΍Ψϥέʔʹμ΢ϯϩʔυ͢Δ w ϓϦըΛ࢖ͬͨ4/4 w Խহ඼ͷϓϨθϯτ w ϓϦᝑମͷޱίϛ

    ฐࣾͷαʔϏεϐΫτϦϯΫ !12
  13. w தֶੜʙେֶੜͷ(*3-4͕λʔήοτ
 ˞(*3-4ʜࣗ෼Λ(*3-4ͱೝ͍ࣝͯ͠Δ͢΂ͯͷਓ  w ձһ਺ສਓҎ্ w ଔۀࣜɺϋϩ΢ΟϯɺΫϦεϚεͳͲʹ
 ΞΫηε͕૿͑Δ ฐࣾͷαʔϏεϐΫτϦϯΫ

    !13
  14. w ೥Ψϥέʔ޲͚αΠτΛϦϦʔε
 αʔόʔͷ࣮૷͸+BWB w ೥εϚϗ޲͚αΠτωΠςΟϒΞϓϦΛϦϦʔε
 αΠτΞϓϦͷαʔόʔ͸ͱ΋ʹ+BWB
 "OESPJEΞϓϦ΋+BWB w ೥ݱࡏʜ
 ਓͰӡ༻։ൃத

    ฐࣾͷαʔϏεϐΫτϦϯΫ !14
  15. w ೥Ψϥέʔ޲͚αΠτΛϦϦʔε
 αʔόʔͷ࣮૷͸+BWB w ೥εϚϗ޲͚αΠτωΠςΟϒΞϓϦΛϦϦʔε
 αΠτΞϓϦͷαʔόʔ͸ͱ΋ʹ+BWB
 "OESPJEΞϓϦ΋+BWB w ೥ݱࡏʜ
 ਓͰӡ༻։ൃத

    ฐࣾͷαʔϏεϐΫτϦϯΫ !15 
 ࠓ΋มΘΒͣ+BWB+BWB͍ͯ͠Δʂ
  16. ٕज़બ୒ͷ࿩+BWB !16 Ψϥέʔ޲͚αʔϏε͕+BWBͰ͋ͬͨཧ༝ ஌ݟ͕ઌબ୒ࢶͷগͳ͞

  17. w ʙ೥ࠒ+BWB͕ग़࢝Ίͨ࣌୅
 ιϑτ΢ΣΞ։ൃݚڀͷΑ͏ͳͱ͜Ζ
 +BWBͰԿ͔ࣄۀ͕Ͱ͖ͳ͍͔ͱ໛ࡧ ٕज़બ୒ͷ࿩ !17 Ψϥέʔ޲͚αʔϏε͕+BWBͰ͋ͬͨཧ༝ +BWBͰ
 Կ͔ʜ

  18. ٕज़બ୒ͷ࿩ !18 Ψϥέʔ޲͚αʔϏε͕+BWBͰ͋ͬͨཧ༝ w ʙ೥ࠒ+BWB͕ग़࢝Ίͨ࣌୅
 +BWBͰԿ͔ࣄۀ͕Ͱ͖ͳ͍͔ͱ໛ࡧ w ௨৴ܥϛυϧ΢ΣΞ͕׬੒

  19. ٕज़બ୒ͷ࿩ !19 Ψϥέʔ޲͚αʔϏε͕+BWBͰ͋ͬͨཧ༝ Τϯλϝ
 ͍ͨ͠ͳ w ΤϯλʔςΠϯϝϯτܥͷ͜ͱ΋͍ͨ͠ʂ
 ϓϦػͱΨϥέʔͷ௨৴ͱ͔Ͳ͏ͩΖ͏͔

  20. ٕज़બ୒ͷ࿩ !20 Ψϥέʔ޲͚αʔϏε͕+BWBͰ͋ͬͨཧ༝ w ΤϯλʔςΠϯϝϯτܥͷ͜ͱ΋͍ͨ͠ʂ w ଞͷݴޠ΋ݕ౼ͯ͠Έͨˠબ୒ࢶ͕গͳ͍ w "QBDIF5PNDBUͰͭ͘ΔΑ͏ͳ΋ͷ 1FSM

    "QBDIF "QBDIF
 5PNDBU +BWB
  21. ٕज़બ୒ͷ࿩ !21 Ψϥέʔ޲͚αʔϏε͕+BWBͰ͋ͬͨཧ༝ w ΤϯλʔςΠϯϝϯτܥͷ͜ͱ΋͍ͨ͠ʂ w ଞͷݴޠ΋ݕ౼ͯ͠Έͨˠબ୒ࢶ͕গͳ͍ w "QBDIF5PNDBUͰͭ͘ΔΑ͏ͳ΋ͷ w

    ࣾ಺ʹ+BWBͷ஌ݟ͕ཷ·͍ͬͯΔͳʜ 1FSM "QBDIF "QBDIF
 5PNDBU +BWB
  22. ٕज़બ୒ͷ࿩ !22 Ψϥέʔ޲͚αʔϏε͕+BWBͰ͋ͬͨཧ༝ w ΤϯλʔςΠϯϝϯτܥͷ͜ͱ΋͍ͨ͠ʂ w ଞͷݴޠ΋ݕ౼ͯ͠Έͨˠબ୒ࢶ͕গͳ͍ w "QBDIF5PNDBUͰͭ͘ΔΑ͏ͳ΋ͷ w

    ࣾ಺ʹ+BWBͷ஌ݟ͕ཷ·͍ͬͯΔͳʜ +BWB ஌ݟ͕ઌબ୒ࢶͷগͳ͞Ͱ+BWBʹ
  23. ٕज़બ୒ͷ࿩ !23 ҆ఆͱલ਎αʔϏεɺ+7. εϚϗ޲͚αʔϏε͕+BWBʹͳͬͨཧ༝

  24. w ʙ೥ͷϦϦʔεʹ޲͚ٕͯज़ݕ౼Λ͢Δ
 +BWBʹݶΒͣଞͷݴޠ΍ϑϨʔϜϫʔΫ΋ݕ౼ w ֶशίετ͕Ͳͷ͘Β͍ͳͷ͔ w ϑϨʔϜϫʔΫͷ҆ఆ౓߹͍ɹɹͳͲͳͲ ٕज़બ୒ͷ࿩ !24 εϚϗ޲͚αʔϏε͕+BWBʹͳͬͨཧ༝

    4 1MBZ +BWB ʜ 1)1 4DBMB
  25. w ʙ೥ͷϦϦʔεʹ޲͚ٕͯज़ݕ౼Λ͢Δ
 +BWBʹݶΒͣଞͷݴޠ΍ϑϨʔϜϫʔΫ΋ݕ౼ w ࣾ಺ࢿ࢈͸׆༻͍ͨ͠ͷͰ+7.ݴޠ͕ྑ͍
 Ψϥέʔ޲͚αʔϏεͰ։ൃͨ͠ϥΠϒϥϦͳͲ ٕज़બ୒ͷ࿩ !25 εϚϗ޲͚αʔϏε͕+BWBʹͳͬͨཧ༝ 4

    1MBZ +BWB ʜ 1)1 4DBMB
  26. w ʙ೥ͷϦϦʔεʹ޲͚ٕͯज़ݕ౼Λ͢Δ
 +BWBʹݶΒͣଞͷݴޠ΍ϑϨʔϜϫʔΫ΋ݕ౼ w ࣾ಺ࢿ࢈͸׆༻͍ͨ͠ͷͰ+7.ݴޠ͕ྑ͍
 Ψϥέʔ޲͚αʔϏεͰ։ൃͨ͠ϥΠϒϥϦͳͲ w 1MBZͱ4DBMBͷ૊Έ߹Θ͕ͤ҆ఆ͍ͯ͠ͳ͍࣌ظ ٕज़બ୒ͷ࿩ !26

    εϚϗ޲͚αʔϏε͕+BWBʹͳͬͨཧ༝ 4 1MBZ +BWB ʜ 1)1 4DBMB
  27. w ʙ೥ͷϦϦʔεʹ޲͚ٕͯज़ݕ౼Λ͢Δ
 +BWBʹݶΒͣଞͷݴޠ΍ϑϨʔϜϫʔΫ΋ݕ౼ w ࣾ಺ࢿ࢈͸׆༻͍ͨ͠ͷͰ+7.ݴޠ͕ྑ͍
 Ψϥέʔ޲͚αʔϏεͰ։ൃͨ͠ϥΠϒϥϦͳͲ w 1MBZͱ4DBMBͷ૊Έ߹Θ͕ͤ҆ఆ͍ͯ͠ͳ͍࣌ظ ٕज़બ୒ͷ࿩ !27

    εϚϗ޲͚αʔϏε͕+BWBʹͳͬͨཧ༝ 4 1MBZ +BWB ʜ 1)1 4DBMB ҆ఆͱલ਎αʔϏεɺ+7.Ͱ+BWBʹ
  28. w ೥Ψϥέʔ޲͚αΠτΛϦϦʔε
 ஌ݟ͕ઌબ୒ࢶͷগͳ͔͞Β+BWBʹ w ೥εϚϗ޲͚αΠτωΠςΟϒΞϓϦΛϦϦʔε
 ҆ఆͱલ਎αʔϏεɺ+7.͔Β+BWBʹ ٕज़બ୒ͷ࿩·ͱΊ !28 ݴޠ࢓༷Ͱ͸ͳ͍෦෼͕ओͳཧ༝

  29. ೔ʑͷӡ༻͔ΒΈΔ
 +BWBͰ͋Δཧ༝

  30. !30  ݴޠͷϢʔβʔ͕ଟ͍  ੩తܕ෇͚ίϯύΠϥ͕ڧྗͰ͋Δ  ྫ֎Λ໌֬ʹॲཧͰ͖Δ

  31. !31  ݴޠͷϢʔβʔ͕ଟ͍  ੩తܕ෇͚ίϯύΠϥ͕ڧྗͰ͋Δ  ྫ֎Λ໌֬ʹॲཧͰ͖Δ

  32. Ϣʔβʔ਺ͷগͳ͍ݴޠ΍ϑϨʔϜϫʔΫΛ࢖͍ͬͯͨࠒ w ࣅͨ͜ͱΛ͍ͯ͠Δਓ͕ډͳ͍ w ຊ΋هࣄ΋͋Μ·Γͳ͍ ࠔ͔ͬͯΒղܾ·Ͱ͕ԕ͔ͬͨ ݴޠͷϢʔβʔ͕ଟ͍ !32 ͍ͬͺ͍ͭΒ͍

  33. Ͱ΋+BWBͳΒ w ࣅͨ͜ͱΛ͍ͯ͠Δਓ͕୔ࢁډΔ w ຊ΋هࣄ΋୔ࢁ͋Δ ࠔͬͯ΋ௐ΂Ε͹ॿ͔Δ཰͕ߴ͍ ٯʹ৘ใʹຒ΋Εͯ͠·͏͜ͱ΋͋Δ ݴޠͷϢʔβʔ͕ଟ͍ !33 ͭΒ͘ͳ͍ʂ

  34. ϝϯςφϯε͞Ε͍ͯΔ΋ͷ͕ଟ͘ɺ࢖͍ଓ͚ΒΕΔ҆৺͕͋Δ w ϥΠϒϥϦɺϑϨʔϜϫʔΫͳͲ w ࢖͏ਓ͕ډΔ͠ɺίϛοτ͢Δਓ͕͍Δ େن໛ͳαʔϏεͱͯ͠͸҆৺ͯ͠࢖͑Δ͜ͱ͕خ͍͠ ⾠ར༻͢Δ͚ͩͰͳ͘ίϛοτ͍͖ͯ͠·͠ΐ͏ͱ͍͏࿩ ݴޠͷϢʔβʔ͕ଟ͍ !34

  35. ࣾ಺֎໰ΘͣਓతϦιʔε͕५୔Ͱ͋Δ w ଞ෦ॺͱਓΛߦ͖དྷͰ͖Δ w શ͘ҟͳΔ੡඼Λ࡞Δ෦ॺͱٕज़ަྲྀ͕Ͱ͖Δ
 ᝒମͷ૊ΈࠐΈιϑτ΢ΣΞͷνʔϜͳͲ w ࣾ֎Ͱ΋ਓΛݟ͚ͭ΍͍͢ w ++6($$$ͱ͔΋ָ͍͋ͬͯ͠☺


    ݴޠͷϢʔβʔ͕ଟ͍ !35
  36. !36  ݴޠͷϢʔβʔ͕ଟ͍  ੩తܕ෇͚ίϯύΠϥ͕ڧྗͰ͋Δ  ྫ֎Λ໌֬ʹॲཧͰ͖Δ

  37. +BWB͸੩తܕ෇͚ݴޠ
 ɹɹɹίϯύΠϧ࣌ʹܕνΣοΫΛͯ͘͠ΕΔ ྫ͑͹ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !37

  38. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !38 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ Vegetable getInSeason(List<Vegetable> vegetables); }
  39. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !39 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> vegetables = refrigeratorService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } }
  40. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !40 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> vegetables = refrigeratorService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } } ०ͷ໺ࡊͬͯ
 Ұݸ͡Όͳ͍Αͳ
  41. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !41 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ List<Vegetable> getInSeason(List<Vegetable> vegetables); }
  42. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !42 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> stockVegetables = refrigeratorService.findVegetables(); List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } }
  43. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !43 
 public class KithenController { @Resource VegetableService

    vegetableService; @RequestMapping(path = "/recommend") public ModelAndView recommendMenu() { List<Vegetable> stockVegetables = refrigeratorService.findVegetables(); List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); //ฦ͖ͬͯͨ໺ࡊͰ͓͢͢ΊͷݙཱΛߟ͑Δ… return new ModelAndView("/reccomend.html"); } }  ίϯύΠϧ
 Τϥʔ
  44. ಉ͘͡ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !44 public class ShoppingController { @Resource VegetableService vegetableService;

    @RequestMapping(path = "/market") public ModelAndView market() { List<Vegetable> vegetables = specialPriceService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ०ͷ໺ࡊΛͲ΍͜΍… return new ModelAndView("/market.html"); } } ͸Θʔ͍͢·ͤΜ
 ͦͬͪ΋࢖ͬͯͨ
  45. ʮ͍΍͍΍ͦΕ͸ͳ͍ʯʮͦΜͳ͠ΐͬͺ͍ϛεʜʯ
 ʮͦ΋ͦ΋ͦΜͳमਖ਼ͷ࢓ํʜʯ
 ͱࢥ͍·͕͢ w ٸ͍Ͱमਖ਼͍ͯ͠Δͱ͖ w σʔλΞΫηε૚ʙϓϨθϯςʔγϣϯ૚·ͰҰؾʹ͔͍͍ͯΔͱ͖ w ϥΠϒϥϦ΋·ͱΊͯॻ͍ͯΔͱ͖ ͳͲɺҊ֎΍ͬͯ͠·͏ɻ

    ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !45
  46. ʜઌఔͷίʔυΛϦϦʔε͔ͯ͠Βϲ݄ޙʜ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !46

  47. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !47 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ List<Vegetable> getInSeason(List<Vegetable> vegetables); }
  48. ϥΠϒϥϦଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !48 
 public interface VegetableService { /** *

    ݱࡏͷ०ͷ໺ࡊΛฦ͢ * @return */ List<Vegetable> getInSeason(List<Vegetable> vegetables) throws NoVegetablesException; } ۭͳΒ
 ྫ֎ʹͨ͘͠
 ͳ͖ͬͯͨ
  49. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !49 
 List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); 
 try

    { List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); } catch (NoVegetablesException e) { e.printStackTrace(); } ,JUDIFO$POUSPMMFSͱ 4IPQQJOH$POUSPMMFSͰ
 ࢖͚ͬͯͨͬͳʙ
  50. ར༻ଆͰ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !50 
 List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); 
 try

    { List<Vegetable> vegetables = vegetableService.getInSeason(stockVegetables); } catch (NoVegetablesException e) { e.printStackTrace(); }  ίϯύΠϧ
 Τϥʔ
  51. ػೳ௥Ճ͞Ε͍ͯͨʂ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !51 public class FlyerController { @Resource VegetableService vegetableService;

    @RequestMapping(path = "/available") public ModelAndView availableFlyerView() { List<Vegetable> vegetables = specialPriceService.findVegetables(); Vegetable vegetable = vegetableService.getInSeason(vegetables); //ฦ͖ͬͯͨ०ͷ໺ࡊΛͲ΍͜΍… return new ModelAndView(“/available.html"); } } Θʔ͓
 ͦͬͪ΋࢖ͬͯͨ
  52. ͪ͜Β΋ʮͦΜͳ͜ͱ͋Δʁʯͱࢥ͏͔΋͠Ε·ͤΜ͕ w େ͖ͳ࣮૷ ϲ݄Ҏ্͔͔ΔͳͲ Λ͍ͯ͠Δͱ͖ w ಉ͡ϓϩμΫτʹରͯͦ͠Μͳ࣮૷͕ฒߦͰ૸Δঢ়گͷͱ͖ ͳͲ΍͸Γ΍ͬͯ͠·͏৔໘͕͋Δɻ ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !52

  53. ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗ !53 ࡉ͔͍ϛε͸ಈ͔͢લʹؾ͚ͮΔ΄͏͕
 Ұͭͣͭண࣮ʹ࣮૷ΛਐΊΒΕΔͷͰ
 ॻ͖͸͡Ί͔Β׬ྃ·Ͱ͕ૣ͍ ͱ͸͍͑*%&͕ݡ͘ར༻ՕॴΛ୳ͤͨΓ͢ΔͷͰ
 ίϯύΠϥΛ௨ͣ͞ͱ΋ؾ͚ͮΔͱ΋͍͏

  54. !54  ݴޠͷϢʔβʔ͕ଟ͍  ੩తܕ෇͚ίϯύΠϥ͕ڧྗͰ͋Δ  ྫ֎Λ໌֬ʹॲཧͰ͖Δ

  55. Ϣʔβʔ͕ສਓ͍Δͱʮكͳҟৗܥʯׂ͕ͱΑ͘ൃੜ͢Δ ྫ֎Λ໌֬ʹॲཧͰ͖Δ !55 //΄΅ى͜Γ͑ͳ͍͕… if(hoge.isEmpty()) { return new Collections.emptyList(); }

  56. Ϣʔβʔ͕ສਓ͍Δͱʮكͳҟৗܥʯׂ͕ͱΑ͘ൃੜ͢Δ w ࣮૷࣌఺Ͱ͸ຊ౰ʹك͕ͩͬͨଞͷػೳ௥ՃͰى͖΍͘͢ͳͬͨ w ϦϦʔε͔ͯ͠Β݁ߏك͡Όͳ͍ͳͱൃ֮ɹͳͲͳͲ ྫ֎Λ໌֬ʹॲཧͰ͖Δ !56

  57. Ϣʔβʔ͕ສਓ͍Δͱʮكͳҟৗܥʯׂ͕ͱΑ͘ൃੜ͢Δ ྫ֎Λ໌֬ʹॲཧͰ͖Δ !57 //΄΅ى͜Γ͑ͳ͍͕… if(hoge.isEmpty()) { return new Collections.emptyList(); }

    ى͜ΔΜ͔ʜ
  58. Ϣʔβʔ͕ສਓ͍Δͱʮكͳҟৗܥʯׂ͕ͱΑ͘ൃੜ͢Δ 
 ͜͏͍͏ಛघέʔεʹରͯ͠ɺ
 ࣗ෼͕ͨͪѻ͍΍͍͢ྫ֎Λఆٛͯ͠ॲཧΛଅͤΔͷ͸ར఺ ྫ֎Λ໌֬ʹॲཧͰ͖Δ !58 //΄΅ى͜Γ͑ͳ͍͕… if(hoge.isEmpty()) { return

    throw new HogeIsEmptyException(); } ྫ֎ʹͨͬͨ͠ ΄͏͕͍ͳ
  59. !59  ݴޠͷϢʔβʔ͕ଟ͍  ੩తܕ෇͚ίϯύΠϥ͕ڧྗͰ͋Δ  ྫ֎Λ໌֬ʹॲཧͰ͖Δ

  60. !60  ݴޠͷϢʔβʔ͕ଟ͍  ੩తܕ෇͚ίϯύΠϥ͕ڧྗͰ͋Δ  ྫ֎Λ໌֬ʹॲཧͰ͖Δ  Ћ

  61. ศརͳ΋ͷ͕୔ࢁ͋Γɺ։ൃεϐʔυ͕ૣ͍ w *%&͕ڧྗ
 ϦϑΝΫλϦϯάҰͭͰ΋ݡ͍ػೳ͕උΘ͍ͬͯΔ΋ͷ͕͋Δ
 ิ׬͕ڧྗɺ$POWFSU5P,PUMJOͱ͔·Ͱ͋Δ
 ॻ͘εϐʔυ͕ૣ͘ͳΔ w ඪ४ϥΠϒϥϦ͕ॆ࣮͍ͯ͠Δ
 ϥΠϒϥϦΛ୳͕࣌ؒ͢ݮΔͷͰ࣮૷ʹूதͰ͖Δ ʲ

    Ћʳ
 ։ൃ؀ڥ͕ڧྗͳ࿩ !61
  62. ศརͳ΋ͷ͕୔ࢁ͋Γɺ։ൃεϐʔυ͕ૣ͍ ॳ৺ऀͰ΋ʮ·ͣಈ͘΋ͷʯ͕ग़དྷ্͕Δ·Ͱ͕ૣ͍ w ࠔͬͨˠͰָ͖͍͕ͨ͠ૣ͍ w ࣗ৴ͱ͔Ϟνϕʔγϣϯʹ௚݁͢Δ ʲ Ћʳ ։ൃ؀ڥ͕ڧྗͳ࿩ !62

  63. ʲ͓·͚ʳ
 +%,ͷҠߦͷ࿩

  64. w ϐΫτϦϯΫͰ͸0SBDMF+%,Λ࢖͍ͬͯͨ +%,ͷҠߦ !64 0SBDMF +%,ʙ̇

  65. w ϐΫτϦϯΫͰ͸0SBDMF+%,Λ࢖͍ͬͯͨ w 0SBDMFͷαϙʔτϙϦγʔ͕มΘͬͨ
 ࣮ӡ༻Ͱ࢖͑Δ+%,͸೥݄·Ͱ
 Ҿ͖ଓ͖࢖͏ʹ͸ܖ໿͕ඞཁ
 ͦΕ΋೥ؒͰαϙʔτऴྃͷ༧ఆ
 +%,Ҏ߱΋ಉ͘͡ܖ໿͕ඞཁ w Կ͔͠ΒରԠΛ͠ͳͯ͘͸ͳΒͳ͍ঢ়گ

    +%,ͷҠߦ !65 αϙʔτ ऴΘΔΑʂ 
  66. ߟ͑ΒΕΔબ୒ࢶ͸͍͔ͭ͘ w 0SBDMF+%,Ͱܖ໿͢Δ w 0SBDMF+%,Ͱܖ໿͢Δ w ֤ࣾஂମͷ+%,ʹҠߦ͢Δ w ͍ͬͦଞͷݴޠʹͯ͠͠·͏ +%,ͷҠߦ

    !66
  67. ߟ͑ΒΕΔબ୒ࢶ͸͍͔ͭ͘ w 0SBDMF+%,Ͱܖ໿͢Δ w 0SBDMF+%,Ͱܖ໿͢Δ w ֤ࣾஂମͷ+%,ʹҠߦ͢Δ w ͍ͬͦଞͷݴޠʹͯ͠͠·͏ +%,ͷҠߦ

    !67 ͙͢ʹରԠ͢Δͷ͸೉͍͠ ͙͢ʹରԠ͢Δͷ͸೉͍͠ ͳ͔ͳ͔ͷֹۚʹͳΓͦ͏ʜ ͳ͔ͳ͔ͷֹۚʹͳΓͦ͏ʜ
  68. w ͻͱ·ͣ"EPQU0QFO+%,ʹҠߦ͢Δ͜ͱʹ w खॱʹಛผͳ͜ͱ͸ͳ͍ w ΞϓϦέʔγϣϯ͔Β"EPQU0QFO+%,Λࢀর͢ΔΑ͏ʹ͢Δ w ςετ؀ڥͰϏϧυɺϢχοτςετ͕௨Δ͔νΣοΫ w ϲ݄΄Ͳςεταʔόʔʹஔ͍ͯΞϓϦέʔγϣϯΛ৮Γ͓ͨ͢

    w όά౳Έ͋ͨΒͳ͚Ε͹ϦϦʔε +%,ͷҠߦ !68 ࠓίί
  69. ࠓޙ w վΊͯͲͷ+%,ʹ͢Δͷ͔ w +BWBͷόʔδϣϯ΋Ͳ͏͢Δͷ͔ ͳͲΛݕ౼ͯ͠௥ͬͯରԠΛ͍ͯ͘͠༧ఆ +%,ͷҠߦ !69

  70. ͱɺ͞Βͬͱ࿩͕͓ΘΓ·͕ͨ͠ +%,ͷҠߦ !70

  71. w ରԠ͢ΔதͰɺ+BWBࣗମʹର͢ΔࠔΓ͝ͱ͸ಛʹແ͔ͬͨ w ਓͰ೰·ͳͯ͘΋ɺੈքதͷਓͷҙݟ͕ಘΒΕΔ w 0SBDMFҎ֎ʹ΋+%,ͷఏڙऀ͕͍Δ w ݟ͔ͭͬͨ՝୊͸ࣾ಺ͷ໰୊͹͔Γ w ৽͍͠όʔδϣϯʹ͙͢ʹରԠͰ͖ͳ͍ঢ়گΞʔΩςΫνϟ

    +%,ͷҠߦ !71
  72. ݁࿦

  73.  ྺ࢙తܦҢ
 ࣾ಺ʹઌʹ஌ݟ͕͋ͬͨɺଞͷબ୒ࢶͷͳ͞  ݴޠͷϢʔβʔ͕ଟ͍  ੩తܕ෇͚ͰίϯύΠϥ͕ڧྗͰ͋Δ  ྫ֎Λ໌֬ʹॲཧͰ͖Δ ϐΫτϦϯΫ͕+BWBͰ͋Δཧ༝

    !73
  74. !74 ʮ+BWB͕దͨ͠αʔϏεͱ͸Կ͔ʯ

  75. !75 w Ϣʔβʔ਺͕ଟ͘ɺن໛͕େ͖͍αʔϏε w ίϛοτ͢Δϝϯόʔ͕มԽ͠΍͍͢ɺ
 ͍ͭ୭͕Ͳ͜Λ৮Δ͔ಡΊͳ͍αʔϏε

  76. !76 w Ϣʔβʔ਺͕ଟ͘ɺن໛͕େ͖͍αʔϏε w ίϛοτ͢Δϝϯόʔ͕มԽ͠΍͍͢ɺ
 ͍ͭ୭͕Ͳ͜Λ৮Δ͔ಡΊͳ͍αʔϏε Έͳ͞Μͷ͝ҙݟ΋
 ͥͻฉ͖͍ͨͰ͢ʂ

  77. !77 ϐΫτϦϯΫ͸+BWBͰΑ͔ͬͨʁ

  78. !78 :&4

  79. w ୭͕Ͳ͜Λ͍ͭ৮Δ͔Θ͔Βͳ͍ঢ়ଶ
 গͳ͘ͱ΋νʔϜ͸ίʔυΛ৮ΔڪΕ͕͋ΔϓϩμΫτ
 ͪΐͪ͜ΐ͜ଞ෦໳͔Βਓ͕དྷͨΓνʔϜฤ੒͕มΘͬͨΓ͢Δ
 ͳͷͰ w ੩తܕ෇͚Ͱ͋Δ͜ͱͰࣗ෼ͷ஌Βͳ͍ͱ͜Ζ΋ͳΔ΂҆͘શʹ͠΍͍͢ w ଞ෦ॺ΋+BWBྺͷ͋Δਓ͕ଟ͍ͷͰߦ͖དྷ͠΍͍͢ ϐΫτϦϯΫ͕+BWBͰ͋Δཧ༝

    !79
  80. w Ϣʔβ਺͕ສਓ͍ΔͰ͔͍αʔϏεͰ͋Δ
 ίϯύΠϧஈ֊Ͱ͔ͬ͠ΓνΣοΫͨ͠΋ͷΛੈʹग़ͤΔͷ͸͍ͩ͡
 ϥΠϒϥϦͳͲ΋ϝϯς͞ΕͯΔ΋ͷ͕͔ͭ͑Δͷ͸خ͍͠
 ҆શͳαʔϏεΛఏڙ͠΍͍͢ w ίʔυͷϘϦϡʔϜɺաڈͷࢿ࢈΋͔ͳΓͰ͔͍
 աڈͷࢿ࢈ͱ͍͏ҙຯͰ͸+7.ݴޠͰ͋Ε͹׆༻Ͱ͖Δ ϐΫτϦϯΫ͕+BWBͰ͋Δཧ༝ !80

  81. ͓͠Βͤ

  82. ͓஌Βͤͦͷ̍ !82 Ұॹʹಇ͘ϝϯόʔΛืूதͰ͢ɻ ΤϯδχΞืूதʂ

  83. ͓஌Βͤͦͷ̍ !83 w ژ౎Ӻɹెา෼ w ΧϯϑΝϨϯε͸ࣾඅͰʂ
 ަ௨අ॓ധඅࢀՃඅ͓څྉग़·͢ w ࣾ಺Ͱͷษڧձ΋͍Ζ͍Ζ w

    ৄ͘͠͸ͪ͜Β ΤϯδχΞืूதʂ
  84. ͓஌Βͤͦͷ !84 ژ౎%FW͔;͐ w ژ౎Ӻલʙ w ςʔϚ͸৭ʑ w ίʔώʔɺ࠙਌ձ෇͖ w

    ৄ͘͠͸DPOOQBTTͰʂ ษڧձ΍ͬͯΔͷͰདྷ͍ͯͩ͘͞ʂ
  85. ͓஌Βͤͦͷ !85 ొஃऀ΋ืूதͰ͢ʂ $G1ग़͔ͨͬͨ͠3FKFDUͩͬͨ
 ࣗ෼͕Έͨηογϣϯ·ͱΊ
 ͳͲͳͲͳΜͰ΋͟͝Εʂ

  86. ສϢʔβʔͷ8FCαʔϏεΛ
 ೥ӡ༻ͯ͠ߟ͑Δɺ+BWBͰ͋Δཧ༝ ϑϦϡʔגࣜձࣾླ໦ਅੜ !NBTBP[Jʣ ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ