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

Spring & Spring Boot 基本のキ / Spring & Spring Boo...

otty375
February 23, 2019

Spring & Spring Boot 基本のキ / Spring & Spring Boot for Beginner

otty375

February 23, 2019
Tweet

More Decks by otty375

Other Decks in Programming

Transcript

  1. Spring Project ͷҰ෦ • Spring Framework • Spring Data •

    Spring Security • Spring Batch • Spring Boot  
  2. Spring Framework ͷҰ෦ • Spring Core • Dependency Injection (DI)

    • Aspect Oriented Programming (AOP) • Spring MVC • Spring Testing  
  3. %*ίϯςφ   @Service 4BNQMF4FSWJDF @Controller @Autowired 4BNQMF$POUSPMMFS QSJWBUFpOBM4BNQMF4FSWJDFTBNQMF4FSWJDF 4BNQMF$POUSPMMFS

    4BNQMF4FSWJDFTBNQMF4FSWJDF \ UIJTTBNQMF4FSWJDFTBNQMF4FSWJDF ^ ΠϯδΣΫγϣϯͷਤ ᶃ
  4. %*ίϯςφ   @Service 4BNQMF4FSWJDF #FBO 4BNQMF4FSWJDF #FBO 4BNQMF$POUSPMMFS @Controller

    @Autowired 4BNQMF$POUSPMMFS QSJWBUFpOBM4BNQMF4FSWJDFTBNQMF4FSWJDF 4BNQMF$POUSPMMFS 4BNQMF4FSWJDFTBNQMF4FSWJDF \ UIJTTBNQMF4FSWJDFTBNQMF4FSWJDF ^ ΠϯδΣΫγϣϯͷਤ ᶄ ΠϯδΣΫγϣϯ
  5. Spring MVC ͷ಺෦ॲཧ   ᶃ ֎෦͔ΒϦΫΤετ͕΍ͬͯ͘Δ ᶄ DispatcherServlet͕HandlerMappingʹϦΫΤετ͢Δ ᶅ

    HandlerMapping͕ϦΫΤετʹԠͨ͡ControllerΛฦͯ͘͠ΕΔ ᶆ DispatcherServlet͕ControllerʹॲཧΛҕৡ͢Δ ᶇ Controller͕View໊ͱModelΛฦ͢ ᶈ DispatcherServlet͕View໊ΛViewResolverʹ౉͢ ᶉ ViewResolver͕Viewͷ׬શύεΛฦ͢ ᶊ DispatcherServlet͕ViewʹModelΛ౉͢ ᶋ View͸ModelΛݩʹHTMLΛ૊Έཱͯͯฦ͢ ᶌ ֎෦ʹHTMLϨεϙϯεΛฦ͢
  6. ࠓճѻ͏෦෼   ᶃ ֎෦͔ΒϦΫΤετ͕΍ͬͯ͘Δ ᶄ DispatcherServlet͕HandlerMappingʹϦΫΤετ͢Δ ᶅ HandlerMapping͕ϦΫΤετʹԠͨ͡ControllerΛฦͯ͘͠ΕΔ ᶆ

    DispatcherServlet͕ControllerʹॲཧΛҕৡ͢Δ ᶇ Controller͕View໊ͱModelΛฦ͢ ᶈ DispatcherServlet͕View໊ΛViewResolverʹ౉͢ ᶉ ViewResolver͕Viewͷ׬શύεΛฦ͢ ᶊ DispatcherServlet͕ViewʹModelΛ౉͢ ᶋ View͸ModelΛݩʹHTMLΛ૊Έཱͯͯฦ͢ ᶌ ֎෦ʹHTMLϨεϙϯεΛฦ͢
  7. ModelͷྲྀΕͷਤ ᶅ   ϑϩϯτίϯτϩʔϥ %JTQBUDIFS4FSWMFU )BOEMFS.BQQJOH $POUSPMMFS 7JFX3FTPMWFS 7JFX

    .PEFM greeting = "hello" <p th:text="${greeting}"></p> <p>hello</p> .PEFM
  8. Spring & Spring Boot ·ͱΊ • ෳ਺ͷίϯϙʔωϯτʢSpring Core, Spring MVC,

    etc.ʣͷ૊Έ߹ΘͤͰͰ͖͍ͯΔ • Springͷࠜװ͸DIʹ͋Γ • SpringΛΑΓखܰʹ࢖͑ΔΑ͏ʹͨ͠ͷ͕ Spring Boot  
  9. ࢀߟࢿྉʢWebʣ • Spring ެࣜαΠτ • https://spring.io/ • ॳΊͯͰ΋30෼Ͱ෼͔ΔSpring 5 &

    Spring Boot 2Φʔ όʔϏϡʔ • https://www.slideshare.net/ masatoshitada7/30spring-5-spring- boot-2-103523666