SlideShare una empresa de Scribd logo
1 de 94
Descargar para leer sin conexión
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3 1
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
2
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

3
基礎を固めよ!
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
4
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
5
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
6
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
▸
7
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
8
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
▸
9
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
10
Spring Web 4 Spring MVC
Spring Boot Developer 2 Spring Boot
Spring Cloud Services
3
( )
Spring Cloud Microservices
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
11
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
12
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
13
Spring Framework
Spring Boot
Spring Cloud
Data, Security, Batch, …
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
14
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
15
※CoC : Convention over Configuration ( )







Seasar2 Ruby on Rails
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸


▸
16
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
17
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
18
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
▸
19
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
20
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

@Component
21
package	hoge.service.impl;	
@Component	
public	class	FooServiceImpl	
								implements	FooService	{	
		//	 	
}
※ ( FooService)
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ @Configuration 

@ComponentScan
22
package	hoge.config;	
@Configuration	
@ComponentScan(basePackages	=	{	
		“hoge.service.impl”})	
public	class	AppConfig	{	
		//	 OK	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ basePackages
@Component
23
hoge
config
service
impl
bar
App	
Config
FooService	
Impl
Bar
FooService


(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ AnnotationConfigApplicationContext 

▸ ApplicationContext
24
//	 	
//	 	
ApplicationContext	context	=		
		new	AnnotationConfigApplicationContext(	
				AppConfig.class);
※ Java Config
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸ getBean()
25
ApplicationContext	context	=	…;	
FooService	fs	=	
		context.getBean(FooService.class);
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
26
@Component	//	 	
public	class	FooController	{	
		private	final	FooService	fs;	//	 	
			
		@Autowired	//	 	
		public	FooController(FooService	fs)	{	
				this.fs	=	fs;	
		}}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ @Bean 

27
@Configuration	//	@ComponentScan 	
public	class	AppConfig2	{	
		@Bean	
		public	BarService	barService()	{	
						//	 	
				return	new	BarServiceImpl();	
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ @Bean
28
@Configuration	
public	class	AppConfig3	{	
		@Bean	
		public	BarService	barService(	
																	BarRepository	br)	{	
				return	new	BarServiceImpl(br);	
		}	
}


Bean 

(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ @Component
29
ApplicationContext	context	=		
		new	AnnotationConfigApplicationContext(	
				AppConfig2.class);	
BarService	bs	=	context.getBean(BarService.class);
@Component	
public	class	BarController	{	
		private	final	BarService	bs;	
			
		@Autowired	//	 	
		public	BarController(BarService	bs)	{	
				this.bs	=	bs;	
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 	
▸ @Bean
▸ basePackages @Component
30
@Configuration	
@ComponentScan(basePackages	=		
		“hoge.service.impl”)	
public	class	AppConfig4	{	
		@Bean	
		public	BarService	barService()	{	
				return	new	BarServiceImpl();	
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸ @Component
▸ @Bean
31
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
32
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
33
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
34


View	
Resolver ※ 

Spring Spring 

Dispatcher

Servlet
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
DispatcherServlet
▸
▸
WebApplicationInitialzer
▸
▸
35
Dispatcher

Servlet
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

▸
▸ 

DispatcherServlet
36
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
ViewResolver
▸
▸ ”employee/index”

”/WEB-INF/views/employee/index.jsp”
▸
▸ InternalResourceViewResolver	
▸ ThymeleafViewReseolver	
▸ FreeMarkerViewResolver	
37
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
ViewResolver
38
@Configuration	
public	class	MvcConfig	…	{	
		@Bean	
		public	InternalResourceViewResolver		
								viewResolver()	{	
				InternalResourceViewResolver	vr	=		
						new	InternalResourceViewResolver();	
				vr.setPrefix("/WEB-INF/views/");	
				vr.setSuffix(".jsp");	
				return	vr;	
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
ViewResolver
▸ DispatcherServlet ViewResolver
39
https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/springframework/web/servlet/
DispatcherServlet.java#L733
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

ViewResolver
▸
▸
▸
▸
40
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

ViewResolver
▸
▸
▸
▸
41
@EnableWebMvc
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
@EnableWebMvc
▸ @Import
▸
▸ @EnableXxx 

42
https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/
springframework/web/servlet/config/annotation/EnableWebMvc.java#L101
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ @Controller
▸ @Component
43
package	hoge.controller	
@Controller	
@RequestMapping(“/employee”)	
public	class	EmployeeController	{	
		@GetMapping(“/index”)	
		public	String	index()	{	
				return	“employee/index”;	
		}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ @Component 	
▸ @Controller	
▸ @RestController	
▸ @Configuration	👈 	
▸ @Service	
▸ @Repository	
44
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
45
@ComponentScan(basePackages	=		
				“hoge.controller”)	
@Configuration	
public	class	MvcConfig	{	
		…	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
46
@EnableWebMvc	
@ComponentScan(basePackages	=		
				“hoge.controller”)	
@Configuration	
public	class	MvcConfig	…	{	
		@Bean	
		public	InternalResourceViewResolver		
								viewResolver()	{	
				…	
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
47
DispatcherServlet
ViewResolver

Bean


Bean


Bean


Bean
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ DispatcherServlet 

▸ 

	
▸ @EnableWebMvc 	
▸ @Controller @ComponentScan 

48
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸ 

▸
▸
49
https://www.casareal.co.jp/recruit/jobs/
ls_teacher.php
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

✕ 

✕
▸ 







50
https://www.casareal.co.jp/ls/service/shinjinseminar/course01
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
51
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
52
ViewResolver

Bean


Bean
DataSource

Bean


Bean


Bean


Bean


Bean


Bean
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
53
ViewResolver

Bean


Bean
DataSource

Bean


Bean


Bean


Bean


Bean


Bean
Bean


Bean
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
54
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
55
@Configuration	
public	class	ThymeleafAutoConfiguration	{	
		…	
		@Configuration	
		public	static	class	XxxConfiguration	{	
				@Bean	
				public	ThymeleafViewResolver	
								thymeleafViewResolver()	{	
						…	
				}	
				…	
※static Java Config 

ViewResolver 

https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/
springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L183
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
▸
56
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

▸
▸
▸
▸
57
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
@ConfigurationProperties
▸
58
@ConfigurationProperties(prefix	=	“spring.thymeleaf”)	
public	class	ThymeleafProperties	{	
		…	
		private	Charset	encoding	=	DEFAULT_ENCODING;	
		private	boolean	cache	=	true;	
		//	 	
}
spring.thymeleaf.encoding=Shift_JIS	
spring.thymeleaf.cache=false
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/
springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
@EnableConfigurationProperties
▸ @ConfigurationProperties
▸ @Component/@Bean
59
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/
springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L74
@EnableConfigurationProperties(	
				ThymeleafProperties.class)	
@Configuration	
public	class	ThymeleafAutoConfiguration	{	
		…
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸ 

	
▸ @ConfigurationProperties
60
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
61
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
62
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
63
@SpringBootApplication	
public	class	SampleApplication	{	
		public	static	void	main(String[]	args)	{	
				SpringApplication.run(	
								SampleApplication.class);	
		}	
}
@EnableAutoConfiguration	
@Configuration	
@ComponentScan	
public	@interface		
				SpringBootApplication	{	…
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
64
@EnableAutoConfiguration
org.springframework.boot.autoconfigure.EnableAutoCon
figuration=	
org.springframework.boot.autoconfigure.admin.SpringA
pplicationAdminJmxAutoConfiguration,	
org.springframework.boot.autoconfigure.aop.AopAutoCo
nfiguration,	
org.springframework.boot.autoconfigure.amqp.RabbitAu
toConfiguration,	
…


AutoConfiguration 

https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/
resources/META-INF/spring.factories


(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
65
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 

▸
▸ 

66
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
@ConditionalOnXxx
▸ @Bean
▸
67
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
ThymeleafAutoConfiguration
68
@Configuration	
@ConditionalOnClass(TemplateMode.class) 	
@AutoConfigureAfter({WebMvcAutoConfiguration.class,	…	})	
public	class	ThymeleafAutoConfiguration	{	
		…	
		@Configuration	
		@ConditionalOnWebApplication(…)	
		public	static	class	XxxConfiguration	{	
				@Bean	
				@ConditionalOnMissingBean(	
								name	=	“thymeleafViewResolver”)	
				public	ThymeleafViewResolver	thymeleafViewResolver()	{	
						…
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/
springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L183
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
@ConditionalOnClass
▸
@ConditionalOnBean
▸
@ConditionalOnMissingBean
▸
69
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
@ConditionalOnProperty
▸
@ConditionalOnWebApplication
▸
@AutoConfigureAfter/@AutoConfigureBefore
▸
70
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ @EnableAutoConfiguration
▸ @ConditionalOnXxx
71
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
72
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
😭
@ConditionalOnMissingBean(Bean_1.class) 

@ConditionalOnBean(Bean_2.class) 

73
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
Spring Bootのべからず集
一.フレームワークを動かすBean
は、なるべく自前で定義する
べからず

二.@EnableXxxはなるべく付ける
べからず
74
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸ @EnableXxx
▸
▸
75
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3


76
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
77
https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
78
@Configuration	
public	class	SomeConfiguration	{	
		private	final	SomeBean	sb;	
		@Autowired	//	 		
		public	SomeConfiguration(SomeBean	sb)	{	
				this.sb	=	sb;	
		}	
		@PostConstruct	//	 	
		public	void	init()	{	
				sb.setXxx(…);	//	SomeBean 		
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
79
@Configuration	
public	class	MyThymeleafConfiguration	{	
		@Bean	
		public	FooDialect	fooDialect()	{	
				return	new	FooDialect();	
		}	
		@Bean	
		public	BarDialect	barDialect()	{	
				return	new	BarDialect();	
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ ThymeleafAutoConfiguration 

Dialect 

TemplateEngine Dialect
80
FooDialect

Bean
BarDialect

Bean
&Template

Engine

Bean &
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
81
@Configuration	
protected	static	class	ThymeleafDefaultConfiguration	{	
		//	Dialect Bean DI 	
		public	ThymeleafDefaultConfiguration(...,	
						ObjectProvider<Collection<IDialect>>	dProvider)	{	
				…	
		}	
			
		@Bean	
		public	SpringTemplateEngine	templateEngine()	{	
				SpringTemplateEngine	engine	=		
								new	SpringTemplateEngine();	
				//	Dialect 	
				this.dialects.forEach(engine::addDialect);	
				return	engine;	
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/
springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L140
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ XxxCustomizer
▸
▸
82
@FunctionalInterface	
public	interface	Jackson2ObjectMapperBuilderCustomizer	{	
	 void	customize(Jackson2ObjectMapperBuilder	builder);	
}
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/
springframework/boot/autoconfigure/jackson/Jackson2ObjectMapperBuilderCustomizer.java
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
83
@Configuration	
public	class	MyJacksonConfiguration	{	
		@Bean	
		public	Jackson2ObjectMapperBuilderCustomizer	
						jackson2ObjectMapperBuilderCustomizer()	{	
				//	 OK	
				return	builder	->	{	
						//	 	
						builder.modules(…)	
										.locale(…)	
										.indentOutput(…);	
				};	
		}	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
84
@Configuration	
static	class	JacksonObjectMapperBuilderConfiguration	{	
		@Bean	
		public	Jackson2ObjectMapperBuilder	…(	
				List<Jackson2ObjectMapperBuilderCustomizer>	
						customizers)	{	
				Jackson2ObjectMapperBuilder	builder	=		
								new	Jackson2ObjectMapperBuilder();	
				for	(Jackson2ObjectMapperBuilderCustomizer	
													customizer	:	customizers)	{	
						customizer.customize(builder);	
				}	
				return	builder;	
		}	
}
https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/
springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java#L172
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ FilterRegistrationBean
85
@Bean	
public	FilterRegistrationBean	myFilter()	{	
		MyFilter	filter	=	new	MyFilter();	
		FilterRegistrationBean	frb	=		
						new	FilterRegistrationBean(filter);	
		//	 url-pattern	
		frb.addUrlPatterns(“/*”);	
		//	 	
		frb.setOrder(Ordered.HIGHEST_PRECEDENCE	+	10);	
		return	frb;	
}
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
86
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
87
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
88
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
89
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
▸
90
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
▸
▸
▸
▸
▸
▸ 

91
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸ 😡
▸
▸ 



92
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
▸
93
(C) CASAREAL, Inc. All rights reserved.
#jjug #ccc_ef3
▸
94

Más contenido relacionado

La actualidad más candente

Spring Bootをはじめる時にやるべき10のこと
Spring Bootをはじめる時にやるべき10のことSpring Bootをはじめる時にやるべき10のこと
Spring Bootをはじめる時にやるべき10のこと心 谷本
 
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -onozaty
 
例外設計における大罪
例外設計における大罪例外設計における大罪
例外設計における大罪Takuto Wada
 
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_cccPivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_cccMasatoshi Tada
 
基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装Masatoshi Tada
 
怖くないSpring Bootのオートコンフィグレーション
怖くないSpring Bootのオートコンフィグレーション怖くないSpring Bootのオートコンフィグレーション
怖くないSpring Bootのオートコンフィグレーション土岐 孝平
 
Spring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作るSpring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作るGo Miyasaka
 
Springを何となく使ってる人が抑えるべきポイント
Springを何となく使ってる人が抑えるべきポイントSpringを何となく使ってる人が抑えるべきポイント
Springを何となく使ってる人が抑えるべきポイント土岐 孝平
 
ドメイン駆動設計のための Spring の上手な使い方
ドメイン駆動設計のための Spring の上手な使い方ドメイン駆動設計のための Spring の上手な使い方
ドメイン駆動設計のための Spring の上手な使い方増田 亨
 
【Spring fest 2019】徹底解剖Spring MVCアーキテクチャー
【Spring fest 2019】徹底解剖Spring MVCアーキテクチャー【Spring fest 2019】徹底解剖Spring MVCアーキテクチャー
【Spring fest 2019】徹底解剖Spring MVCアーキテクチャーssuser070fa9
 
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetupこれで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線MeetupMasatoshi Tada
 
今こそ知りたいSpring Web(Spring Fest 2020講演資料)
今こそ知りたいSpring Web(Spring Fest 2020講演資料)今こそ知りたいSpring Web(Spring Fest 2020講演資料)
今こそ知りたいSpring Web(Spring Fest 2020講演資料)NTT DATA Technology & Innovation
 
What's new in Spring Boot 2.6 ?
What's new in Spring Boot 2.6 ?What's new in Spring Boot 2.6 ?
What's new in Spring Boot 2.6 ?土岐 孝平
 
LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall )
LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall ) LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall )
LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall ) Hironobu Isoda
 
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web ServiceアプリケーションAngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーションssuser070fa9
 
入社1年目のプログラミング初心者がSpringを学ぶための手引き
入社1年目のプログラミング初心者がSpringを学ぶための手引き入社1年目のプログラミング初心者がSpringを学ぶための手引き
入社1年目のプログラミング初心者がSpringを学ぶための手引き土岐 孝平
 
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...NTT DATA Technology & Innovation
 
Java EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行についてJava EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行についてShigeru Tatsuta
 

La actualidad más candente (20)

Spring Bootをはじめる時にやるべき10のこと
Spring Bootをはじめる時にやるべき10のことSpring Bootをはじめる時にやるべき10のこと
Spring Bootをはじめる時にやるべき10のこと
 
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
 
例外設計における大罪
例外設計における大罪例外設計における大罪
例外設計における大罪
 
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_cccPivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
 
基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装
 
Mavenの真実とウソ
Mavenの真実とウソMavenの真実とウソ
Mavenの真実とウソ
 
怖くないSpring Bootのオートコンフィグレーション
怖くないSpring Bootのオートコンフィグレーション怖くないSpring Bootのオートコンフィグレーション
怖くないSpring Bootのオートコンフィグレーション
 
Spring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作るSpring Boot × Vue.jsでSPAを作る
Spring Boot × Vue.jsでSPAを作る
 
Springを何となく使ってる人が抑えるべきポイント
Springを何となく使ってる人が抑えるべきポイントSpringを何となく使ってる人が抑えるべきポイント
Springを何となく使ってる人が抑えるべきポイント
 
ドメイン駆動設計のための Spring の上手な使い方
ドメイン駆動設計のための Spring の上手な使い方ドメイン駆動設計のための Spring の上手な使い方
ドメイン駆動設計のための Spring の上手な使い方
 
【Spring fest 2019】徹底解剖Spring MVCアーキテクチャー
【Spring fest 2019】徹底解剖Spring MVCアーキテクチャー【Spring fest 2019】徹底解剖Spring MVCアーキテクチャー
【Spring fest 2019】徹底解剖Spring MVCアーキテクチャー
 
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetupこれで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
 
今こそ知りたいSpring Web(Spring Fest 2020講演資料)
今こそ知りたいSpring Web(Spring Fest 2020講演資料)今こそ知りたいSpring Web(Spring Fest 2020講演資料)
今こそ知りたいSpring Web(Spring Fest 2020講演資料)
 
What's new in Spring Boot 2.6 ?
What's new in Spring Boot 2.6 ?What's new in Spring Boot 2.6 ?
What's new in Spring Boot 2.6 ?
 
LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall )
LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall ) LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall )
LogbackからLog4j 2への移行によるアプリケーションのスループット改善 ( JJUG CCC 2021 Fall )
 
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web ServiceアプリケーションAngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
 
入社1年目のプログラミング初心者がSpringを学ぶための手引き
入社1年目のプログラミング初心者がSpringを学ぶための手引き入社1年目のプログラミング初心者がSpringを学ぶための手引き
入社1年目のプログラミング初心者がSpringを学ぶための手引き
 
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...
 
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajpAt least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
 
Java EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行についてJava EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行について
 

Destacado

Java SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心にJava SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心にTaku Miyakawa
 
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話Koichiro Matsuoka
 
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜aha_oretama
 
JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座Yusuke Suzuki
 
Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門Takuya Okada
 
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立てユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立てRyosuke Uchitate
 
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017Kohei Saito
 
サーバサイド Kotlin
サーバサイド Kotlinサーバサイド Kotlin
サーバサイド KotlinHiroki Ohtani
 
JVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメJVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメYoshiaki Shibutani
 
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017tty fky
 
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccJEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccYujiSoftware
 
Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜Youtarou TAKAHASHI
 
Javaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチJavaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチCData Software Japan
 
Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13Sho Douhashi
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafMasatoshi Tada
 
マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方CData Software Japan
 
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方Yuki Morishita
 
高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!masakazu matsubara
 
Open Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyOpen Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyTakakiyo Tanaka
 
Another compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilationAnother compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilationLogico
 

Destacado (20)

Java SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心にJava SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心に
 
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
 
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
劇的改善 Ci4時間から5分へ〜私がやった10のこと〜
 
JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座JJUG初心者のためのJava/JJUG講座
JJUG初心者のためのJava/JJUG講座
 
Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門Java9を迎えた今こそ!Java本格(再)入門
Java9を迎えた今こそ!Java本格(再)入門
 
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立てユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
ユニットテストのアサーション 流れるようなインターフェースのAssertJを添えて 入門者仕立て
 
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
 
サーバサイド Kotlin
サーバサイド Kotlinサーバサイド Kotlin
サーバサイド Kotlin
 
JVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメJVM上で動くPython処理系実装のススメ
JVM上で動くPython処理系実装のススメ
 
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
Business Process Modeling in Goldman Sachs @ JJUG CCC Fall 2017
 
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_cccJEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
JEP280: Java 9 で文字列結合の処理が変わるぞ!準備はいいか!? #jjug_ccc
 
Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜Selenide or Geb 〜あなたはその時どちらを使う〜
Selenide or Geb 〜あなたはその時どちらを使う〜
 
Javaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチJavaアプリケーションの モダナイゼーションアプローチ
Javaアプリケーションの モダナイゼーションアプローチ
 
Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13Redmine4時代のプラグイン開発 redmine.tokyo #13
Redmine4時代のプラグイン開発 redmine.tokyo #13
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
 
マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方
 
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
サンプルアプリケーションで学ぶApache Cassandraを使ったJavaアプリケーションの作り方
 
高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!高速なソートアルゴリズムを書こう!!
高速なソートアルゴリズムを書こう!!
 
Open Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere LibertyOpen Liberty: オープンソースになったWebSphere Liberty
Open Liberty: オープンソースになったWebSphere Liberty
 
Another compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilationAnother compilation method in java - AOT (Ahead of Time) compilation
Another compilation method in java - AOT (Ahead of Time) compilation
 

Similar a Spring Bootの本当の理解ポイント #jjug

JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会Masatoshi Tada
 
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~Masatoshi Tada
 
Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-Masatoshi Tada
 
保守・追加開発に必要な「Springの正しい知識」とは?20171109
保守・追加開発に必要な「Springの正しい知識」とは?20171109保守・追加開発に必要な「Springの正しい知識」とは?20171109
保守・追加開発に必要な「Springの正しい知識」とは?20171109CASAREAL, Inc.
 
Spring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsugSpring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsugMasatoshi Tada
 
とにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるとにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるMasatoshi Tada
 

Similar a Spring Bootの本当の理解ポイント #jjug (6)

JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会
 
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
 
Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-
 
保守・追加開発に必要な「Springの正しい知識」とは?20171109
保守・追加開発に必要な「Springの正しい知識」とは?20171109保守・追加開発に必要な「Springの正しい知識」とは?20171109
保守・追加開発に必要な「Springの正しい知識」とは?20171109
 
Spring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsugSpring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsug
 
とにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるとにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みる
 

Más de Masatoshi Tada

Java EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 FallJava EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 FallMasatoshi Tada
 
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新Masatoshi Tada
 
はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)Masatoshi Tada
 
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho ltNetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho ltMasatoshi Tada
 
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2Masatoshi Tada
 
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_cccJPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_cccMasatoshi Tada
 

Más de Masatoshi Tada (6)

Java EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 FallJava EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 Fall
 
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
 
はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)
 
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho ltNetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
 
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
 
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_cccJPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
 

Último

Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 

Último (20)

Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 

Spring Bootの本当の理解ポイント #jjug

  • 1. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 1
  • 2. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 2
  • 3. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 3 基礎を固めよ!
  • 4. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ 4
  • 5. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ 5
  • 6. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 6
  • 7. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ ▸ 7
  • 8. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 8
  • 9. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ ▸ 9
  • 10. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 10 Spring Web 4 Spring MVC Spring Boot Developer 2 Spring Boot Spring Cloud Services 3 ( ) Spring Cloud Microservices
  • 11. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ 11
  • 12. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 12
  • 13. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 13 Spring Framework Spring Boot Spring Cloud Data, Security, Batch, …
  • 14. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ 14
  • 15. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ 15 ※CoC : Convention over Configuration ( )
 
 
 
 Seasar2 Ruby on Rails
  • 16. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 
 ▸ 16
  • 17. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 17
  • 18. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 18
  • 19. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ ▸ 19
  • 20. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 20
  • 21. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 @Component 21 package hoge.service.impl; @Component public class FooServiceImpl implements FooService { // } ※ ( FooService)
  • 22. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ @Configuration 
 @ComponentScan 22 package hoge.config; @Configuration @ComponentScan(basePackages = { “hoge.service.impl”}) public class AppConfig { // OK }
  • 23. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ basePackages @Component 23 hoge config service impl bar App Config FooService Impl Bar FooService 

  • 24. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ AnnotationConfigApplicationContext 
 ▸ ApplicationContext 24 // // ApplicationContext context = new AnnotationConfigApplicationContext( AppConfig.class); ※ Java Config
  • 25. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ getBean() 25 ApplicationContext context = …; FooService fs = context.getBean(FooService.class);
  • 26. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 26 @Component // public class FooController { private final FooService fs; // @Autowired // public FooController(FooService fs) { this.fs = fs; }}
  • 27. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ @Bean 
 27 @Configuration // @ComponentScan public class AppConfig2 { @Bean public BarService barService() { // return new BarServiceImpl(); } }
  • 28. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ @Bean 28 @Configuration public class AppConfig3 { @Bean public BarService barService( BarRepository br) { return new BarServiceImpl(br); } } 
 Bean 

  • 29. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ @Component 29 ApplicationContext context = new AnnotationConfigApplicationContext( AppConfig2.class); BarService bs = context.getBean(BarService.class); @Component public class BarController { private final BarService bs; @Autowired // public BarController(BarService bs) { this.bs = bs; } }
  • 30. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ @Bean ▸ basePackages @Component 30 @Configuration @ComponentScan(basePackages = “hoge.service.impl”) public class AppConfig4 { @Bean public BarService barService() { return new BarServiceImpl(); } }
  • 31. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ @Component ▸ @Bean 31
  • 32. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 32
  • 33. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ 33
  • 34. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 34 
 View Resolver ※ 
 Spring Spring 
 Dispatcher
 Servlet
  • 35. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 DispatcherServlet ▸ ▸ WebApplicationInitialzer ▸ ▸ 35 Dispatcher
 Servlet
  • 36. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 ▸ ▸ 
 DispatcherServlet 36
  • 37. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ViewResolver ▸ ▸ ”employee/index”
 ”/WEB-INF/views/employee/index.jsp” ▸ ▸ InternalResourceViewResolver ▸ ThymeleafViewReseolver ▸ FreeMarkerViewResolver 37
  • 38. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ViewResolver 38 @Configuration public class MvcConfig … { @Bean public InternalResourceViewResolver viewResolver() { InternalResourceViewResolver vr = new InternalResourceViewResolver(); vr.setPrefix("/WEB-INF/views/"); vr.setSuffix(".jsp"); return vr; } }
  • 39. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ViewResolver ▸ DispatcherServlet ViewResolver 39 https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/springframework/web/servlet/ DispatcherServlet.java#L733
  • 40. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 ViewResolver ▸ ▸ ▸ ▸ 40
  • 41. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 ViewResolver ▸ ▸ ▸ ▸ 41 @EnableWebMvc
  • 42. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 @EnableWebMvc ▸ @Import ▸ ▸ @EnableXxx 
 42 https://github.com/spring-projects/spring-framework/blob/master/spring-webmvc/src/main/java/org/ springframework/web/servlet/config/annotation/EnableWebMvc.java#L101
  • 43. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ @Controller ▸ @Component 43 package hoge.controller @Controller @RequestMapping(“/employee”) public class EmployeeController { @GetMapping(“/index”) public String index() { return “employee/index”; }
  • 44. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ @Component ▸ @Controller ▸ @RestController ▸ @Configuration 👈 ▸ @Service ▸ @Repository 44
  • 45. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 45 @ComponentScan(basePackages = “hoge.controller”) @Configuration public class MvcConfig { … }
  • 46. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 46 @EnableWebMvc @ComponentScan(basePackages = “hoge.controller”) @Configuration public class MvcConfig … { @Bean public InternalResourceViewResolver viewResolver() { … } }
  • 47. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 47 DispatcherServlet ViewResolver
 Bean 
 Bean 
 Bean 
 Bean
  • 48. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ DispatcherServlet 
 ▸ 
 ▸ @EnableWebMvc ▸ @Controller @ComponentScan 
 48
  • 49. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ 
 ▸ ▸ 49 https://www.casareal.co.jp/recruit/jobs/ ls_teacher.php
  • 50. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 ✕ 
 ✕ ▸ 
 
 
 
 50 https://www.casareal.co.jp/ls/service/shinjinseminar/course01
  • 51. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 51
  • 52. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 52 ViewResolver
 Bean 
 Bean DataSource
 Bean 
 Bean 
 Bean 
 Bean 
 Bean 
 Bean
  • 53. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 53 ViewResolver
 Bean 
 Bean DataSource
 Bean 
 Bean 
 Bean 
 Bean 
 Bean 
 Bean Bean 
 Bean
  • 54. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 54
  • 55. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 55 @Configuration public class ThymeleafAutoConfiguration { … @Configuration public static class XxxConfiguration { @Bean public ThymeleafViewResolver thymeleafViewResolver() { … } … ※static Java Config 
 ViewResolver 
 https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/ springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L183
  • 56. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ ▸ 56
  • 57. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 ▸ ▸ ▸ ▸ 57
  • 58. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 @ConfigurationProperties ▸ 58 @ConfigurationProperties(prefix = “spring.thymeleaf”) public class ThymeleafProperties { … private Charset encoding = DEFAULT_ENCODING; private boolean cache = true; // } spring.thymeleaf.encoding=Shift_JIS spring.thymeleaf.cache=false https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/ springframework/boot/autoconfigure/thymeleaf/ThymeleafProperties.java
  • 59. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 @EnableConfigurationProperties ▸ @ConfigurationProperties ▸ @Component/@Bean 59 https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/ springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L74 @EnableConfigurationProperties( ThymeleafProperties.class) @Configuration public class ThymeleafAutoConfiguration { …
  • 60. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ 
 ▸ @ConfigurationProperties 60
  • 61. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 61
  • 62. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 62
  • 63. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 63 @SpringBootApplication public class SampleApplication { public static void main(String[] args) { SpringApplication.run( SampleApplication.class); } } @EnableAutoConfiguration @Configuration @ComponentScan public @interface SpringBootApplication { …
  • 64. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 64 @EnableAutoConfiguration org.springframework.boot.autoconfigure.EnableAutoCon figuration= org.springframework.boot.autoconfigure.admin.SpringA pplicationAdminJmxAutoConfiguration, org.springframework.boot.autoconfigure.aop.AopAutoCo nfiguration, org.springframework.boot.autoconfigure.amqp.RabbitAu toConfiguration, … 
 AutoConfiguration 
 https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/ resources/META-INF/spring.factories 

  • 65. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 65
  • 66. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 
 ▸ ▸ 
 66
  • 67. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 @ConditionalOnXxx ▸ @Bean ▸ 67
  • 68. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ThymeleafAutoConfiguration 68 @Configuration @ConditionalOnClass(TemplateMode.class) @AutoConfigureAfter({WebMvcAutoConfiguration.class, … }) public class ThymeleafAutoConfiguration { … @Configuration @ConditionalOnWebApplication(…) public static class XxxConfiguration { @Bean @ConditionalOnMissingBean( name = “thymeleafViewResolver”) public ThymeleafViewResolver thymeleafViewResolver() { … https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/ springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L183
  • 69. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 @ConditionalOnClass ▸ @ConditionalOnBean ▸ @ConditionalOnMissingBean ▸ 69
  • 70. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 @ConditionalOnProperty ▸ @ConditionalOnWebApplication ▸ @AutoConfigureAfter/@AutoConfigureBefore ▸ 70
  • 71. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ @EnableAutoConfiguration ▸ @ConditionalOnXxx 71
  • 72. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 72
  • 73. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 😭 @ConditionalOnMissingBean(Bean_1.class) 
 @ConditionalOnBean(Bean_2.class) 
 73
  • 74. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 Spring Bootのべからず集 一.フレームワークを動かすBean は、なるべく自前で定義する べからず 二.@EnableXxxはなるべく付ける べからず 74
  • 75. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ @EnableXxx ▸ ▸ 75
  • 76. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 
 76
  • 77. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 77 https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
  • 78. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 78 @Configuration public class SomeConfiguration { private final SomeBean sb; @Autowired // public SomeConfiguration(SomeBean sb) { this.sb = sb; } @PostConstruct // public void init() { sb.setXxx(…); // SomeBean } }
  • 79. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 79 @Configuration public class MyThymeleafConfiguration { @Bean public FooDialect fooDialect() { return new FooDialect(); } @Bean public BarDialect barDialect() { return new BarDialect(); } }
  • 80. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ThymeleafAutoConfiguration 
 Dialect 
 TemplateEngine Dialect 80 FooDialect
 Bean BarDialect
 Bean &Template
 Engine
 Bean &
  • 81. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 81 @Configuration protected static class ThymeleafDefaultConfiguration { // Dialect Bean DI public ThymeleafDefaultConfiguration(..., ObjectProvider<Collection<IDialect>> dProvider) { … } @Bean public SpringTemplateEngine templateEngine() { SpringTemplateEngine engine = new SpringTemplateEngine(); // Dialect this.dialects.forEach(engine::addDialect); return engine; https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/ springframework/boot/autoconfigure/thymeleaf/ThymeleafAutoConfiguration.java#L140
  • 82. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ XxxCustomizer ▸ ▸ 82 @FunctionalInterface public interface Jackson2ObjectMapperBuilderCustomizer { void customize(Jackson2ObjectMapperBuilder builder); } https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/ springframework/boot/autoconfigure/jackson/Jackson2ObjectMapperBuilderCustomizer.java
  • 83. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 83 @Configuration public class MyJacksonConfiguration { @Bean public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() { // OK return builder -> { // builder.modules(…) .locale(…) .indentOutput(…); }; } }
  • 84. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 84 @Configuration static class JacksonObjectMapperBuilderConfiguration { @Bean public Jackson2ObjectMapperBuilder …( List<Jackson2ObjectMapperBuilderCustomizer> customizers) { Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); for (Jackson2ObjectMapperBuilderCustomizer customizer : customizers) { customizer.customize(builder); } return builder; } } https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/ springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java#L172
  • 85. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ FilterRegistrationBean 85 @Bean public FilterRegistrationBean myFilter() { MyFilter filter = new MyFilter(); FilterRegistrationBean frb = new FilterRegistrationBean(filter); // url-pattern frb.addUrlPatterns(“/*”); // frb.setOrder(Ordered.HIGHEST_PRECEDENCE + 10); return frb; }
  • 86. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ 86
  • 87. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 87
  • 88. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ 88
  • 89. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ 89
  • 90. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ ▸ 90
  • 91. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ ▸ ▸ ▸ ▸ ▸ ▸ 
 91
  • 92. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 😡 ▸ ▸ 
 
 92
  • 93. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ ▸ 93
  • 94. (C) CASAREAL, Inc. All rights reserved. #jjug #ccc_ef3 ▸ 94