SlideShare a Scribd company logo
1 of 96
Download to read offline
‹#›© 2016 Pivotal Software, Inc. All rights reserved. ‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Spring ❤ Kotlin
Toshiaki Maki (@making)
tmaki@pivotal.io
JJUG Night Seminar 2017 Feb
2017-02-20
© 2016 Pivotal Software, Inc. All rights reserved.
Who am I ?
• Toshiaki Maki (@making) https://ik.am
• Sr. Solutions Architect @Pivotal
• Spring ☘ / Cloud Foundry ☁ / Concourse ✈ / BOSH 🐚
bit.ly/hajiboot2
© 2016 Pivotal Software, Inc. All rights reserved.
Agenda
•Spring Boot with Kotlin
•Kotlin support in Spring 5
‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Spring Boot with Kotlin
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Initializr
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Initializr
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
package com.example



import org.springframework.boot.SpringApplication

import org.springframework.boot.autoconfigure.SpringBootApplication



@SpringBootApplication

class DemoApplication



fun main(args: Array<String>) {

SpringApplication.run(DemoApplication::class.java, *args)

}

© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
package com.example



import org.springframework.web.bind.annotation.GetMapping

import org.springframework.web.bind.annotation.RestController



@RestController

class HelloController {

@GetMapping("/")

fun hello() = "Hello World!"

}


© 2016 Pivotal Software, Inc. All rights reserved.
package com.example



import org.springframework.web.bind.annotation.GetMapping

import org.springframework.web.bind.annotation.RestController



@RestController

class HelloController {

@GetMapping("/")

fun hello() = "Hello World!"

}


© 2016 Pivotal Software, Inc. All rights reserved.
// Kotlin
open class AppConfig {

@Bean

open fun restTemplate() = RestTemplate()

}
© 2016 Pivotal Software, Inc. All rights reserved.
// Kotlin
open class AppConfig {

@Bean

open fun restTemplate() = RestTemplate()

}
👇
👇
© 2016 Pivotal Software, Inc. All rights reserved.
// Kotlin
open class AppConfig {

@Bean

open fun restTemplate() = RestTemplate()

}
👇
👇
😩
© 2016 Pivotal Software, Inc. All rights reserved.
Cglib and Spring
// Java
class AppConfig {

@Bean

RestTemplate restTemplate() {
return new RestTemplate();
}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Cglib and Spring
// Java
class AppConfig {

@Bean

RestTemplate restTemplate() {
return new RestTemplate();
}

}
Singleton
© 2016 Pivotal Software, Inc. All rights reserved.
Cglib and Spring (Pseudo Code)
class AppConfig$$ extends AppConfig {
@Override

RestTemplate restTemplate() {
if (context.contains("restTemplate")) {
return context.get("restTemplate");
}
return super.restTemplate();
}

}
© 2016 Pivotal Software, Inc. All rights reserved.
Cglib and Spring (Pseudo Code)
class AppConfig$$ extends AppConfig {
@Override

RestTemplate restTemplate() {
if (context.contains("restTemplate")) {
return context.get("restTemplate");
}
return super.restTemplate();
}

}
Methods in Kotlin
are final by default !!
open removes final
© 2016 Pivotal Software, Inc. All rights reserved.
<plugin>

<artifactId>kotlin-maven-plugin</artifactId>

<groupId>org.jetbrains.kotlin</groupId>

<version>${kotlin.version}</version>

<configuration>

<compilerPlugins>

<plugin>spring</plugin>

</compilerPlugins>

</configuration>
</plugin>
© 2016 Pivotal Software, Inc. All rights reserved.
open class AppConfig {

@Bean

open fun restTemplate() = RestTemplate()

}
© 2016 Pivotal Software, Inc. All rights reserved.
open class AppConfig {

@Bean

open fun restTemplate() = RestTemplate()

}
© 2016 Pivotal Software, Inc. All rights reserved.
class AppConfig {

@Bean

fun restTemplate() = RestTemplate()

}
© 2016 Pivotal Software, Inc. All rights reserved.
class AppConfig {

@Bean

fun restTemplate() = RestTemplate()

}
😍
© 2016 Pivotal Software, Inc. All rights reserved.
http://start.spring.io/#!language=kotlin
‹#›© 2016 Pivotal Software, Inc. All rights reserved.
Kotlin support in Spring 5
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Framework 5
•Java 8 baseline, Java 9 compatibility
•Reactive Support & Spring WebFlux
•Router Functions
•Performance improvements
•HTTP/2 support
•Kotlin support
© 2016 Pivotal Software, Inc. All rights reserved.
Kotlin Support
© 2016 Pivotal Software, Inc. All rights reserved.
Kotlin Support
© 2016 Pivotal Software, Inc. All rights reserved.
Kotlin Support
•Extension Functions
•Reified type parameters
© 2016 Pivotal Software, Inc. All rights reserved.
Kotlin Support
•Extension Functions
•Reified type parameters
🤔
© 2016 Pivotal Software, Inc. All rights reserved.
package com.example;
public class Foo {
public <T> T create(Class<T> clazz) {
try {
return clazz.newInstance();
}
catch (Exception e) {
throw new IllegalStateException(e);
}
}
}
© 2016 Pivotal Software, Inc. All rights reserved.
// Java
Foo foo = new Foo();
Bar bar = foo.create(Bar.class);
© 2016 Pivotal Software, Inc. All rights reserved.
// Java
Foo foo = new Foo();
Bar bar = foo.create(Bar.class);
// Kotlin
val foo = Foo()
val bar = foo.create(Bar::class.java)
© 2016 Pivotal Software, Inc. All rights reserved.
// Java
Foo foo = new Foo();
Bar bar = foo.create(Bar.class);
// Kotlin
val foo = Foo()
val bar = foo.create(Bar::class.java)
👇
© 2016 Pivotal Software, Inc. All rights reserved.
KClass
Bar::class // kotlin.reflect.KClass
Bar::class.java // java.lang.Class

© 2016 Pivotal Software, Inc. All rights reserved.
Extension Functions
•Extends a class with new functionality
without having to inherit from the class
•https://kotlinlang.org/docs/reference/
extensions.html#extension-functions
© 2016 Pivotal Software, Inc. All rights reserved.
// Kotlin
val foo = Foo()
val bar = foo.create(Bar::class.java)
© 2016 Pivotal Software, Inc. All rights reserved.
// Kotlin
val foo = Foo()
val bar = foo.create(Bar::class.java)
© 2016 Pivotal Software, Inc. All rights reserved.
// Kotlin
val foo = Foo()
val bar = foo.create(Bar::class)
© 2016 Pivotal Software, Inc. All rights reserved.
Extension Functions
// Kotlin
val foo = Foo()
val bar = foo.create(Bar::class)
© 2016 Pivotal Software, Inc. All rights reserved.
Extension Functions
package com.example
import kotlin.reflect.KClass
fun <T : Any> Foo.create(kclass: KClass<T>)
= create(kclass.java)

FooExtensions.kt
© 2016 Pivotal Software, Inc. All rights reserved.
Extension Functions
package com.example
import kotlin.reflect.KClass
fun <T : Any> Foo.create(kclass: KClass<T>)
= create(kclass.java)

👇
FooExtensions.kt
© 2016 Pivotal Software, Inc. All rights reserved.
Extension Functions
// Kotlin
val foo = Foo()
val bar = foo.create(Bar::class)
😍
© 2016 Pivotal Software, Inc. All rights reserved.
Reified type parameters
•Access a type passed to us as a parameter
•https://kotlinlang.org/docs/reference/inline-
functions.html#reified-type-parameters
© 2016 Pivotal Software, Inc. All rights reserved.
Reified type parameters
inline fun <reified T : Any> Foo.create()
= create(T::class.java)

© 2016 Pivotal Software, Inc. All rights reserved.
Reified type parameters
inline fun <reified T : Any> Foo.create()
= create(T::class.java)
👇
👇
© 2016 Pivotal Software, Inc. All rights reserved.
val foo = Foo()
val bar = foo.create(Bar::class)

© 2016 Pivotal Software, Inc. All rights reserved.
val foo = Foo()
val bar = foo.create(Bar::class)

© 2016 Pivotal Software, Inc. All rights reserved.
Reified type parameters
val foo = Foo()
val bar = foo.create<Bar>()

😍
© 2016 Pivotal Software, Inc. All rights reserved.
Reified type parameters
val foo = Foo()
val bar: Bar = foo.create()

😍
© 2016 Pivotal Software, Inc. All rights reserved.
Reified type parameters
val foo = Foo()
val bar: Bar = foo.create()

😍
"idiomatic Kotlin code"
© 2016 Pivotal Software, Inc. All rights reserved.
"idiomatic Kotlin code" with Spring 5
© 2016 Pivotal Software, Inc. All rights reserved.
Application Context
// Java
ApplicationContext context = ...;
Bar bar = context.getBean(Bar.class);
© 2016 Pivotal Software, Inc. All rights reserved.
Application Context (Extension)
// Kotlin
val context = ...
val bar = context.getBean(Bar::class)

© 2016 Pivotal Software, Inc. All rights reserved.
Application Context (Reified Type)
// Kotlin
val context = ...
val bar = context.getBean<Bar>()

© 2016 Pivotal Software, Inc. All rights reserved.
Application Context (Reified Type)
// Kotlin
val context = ...
val bar: Bar = context.getBean()

© 2016 Pivotal Software, Inc. All rights reserved.
JdbcTemplate
// Java
Long count = jdbcTemplate
.queryForObject("SELECT count(*) FROM foo"
, Long.class);
© 2016 Pivotal Software, Inc. All rights reserved.
JdbcTemplate (Extension)
// Kotlin
val count = jdbcTemplate
.queryForObject("SELECT count(*) FROM foo"
, Long::class)
© 2016 Pivotal Software, Inc. All rights reserved.
JdbcTemplate (Reified Type)
// Kotlin
val count = jdbcTemplate
.queryForObject<Long>(
"SELECT count(*) FROM foo")
© 2016 Pivotal Software, Inc. All rights reserved.
JdbcTemplate (Reified Type)
// Kotlin
val count: Long = jdbcTemplate
.queryForObject("SELECT count(*) FROM foo")
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate
// Java
String foo = restTemplate
.getForObject("http://abc.io",String.class);
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate (Reified Type)
// Kotlin
val foo = restTemplate
.getForObject<String>("http://abc.io");
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate (Reified Type)
// Kotlin
val foo: String = restTemplate
.getForObject("http://abc.io");
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate
// Java
List<Foo> foos = restTemplate
.getForObject("http://abc.io",
List<Foo>.class);
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate
// Java
List<Foo> foos = restTemplate
.getForObject("http://abc.io",
List<Foo>.class);
Compile Error!
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate
// Java
List<Foo> foos = restTemplate
.exchange("http://abc.io", HttpMethod.GET,
null, new
ParameterizedTypeReference<List<Foo>>()
{}).getBody();
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate
// Java
List<Foo> foos = restTemplate
.exchange("http://abc.io", HttpMethod.GET,
null, new
ParameterizedTypeReference<List<Foo>>()
{}).getBody();
💩
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate (Reified Type)
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate (Reified Type)
// Kotlin
val foos: List<Foo> = restTemplate
.getForObject("http://abc.io");
© 2016 Pivotal Software, Inc. All rights reserved.
RestTemplate (Reified Type)
// Kotlin
val foos: List<Foo> = restTemplate
.getForObject("http://abc.io");
😍
© 2016 Pivotal Software, Inc. All rights reserved.
Spring ❤ Kotlin
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Framework 5
•Java 8 baseline, Java 9 compatibility
•Reactive Support & Spring WebFlux
•Router Functions
•Performance improvements
•HTTP/2 support
•Kotlin support
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Framework 5
•Java 8 baseline, Java 9 compatibility
•Reactive Support & Spring WebFlux
•Router Functions
•Performance improvements
•HTTP/2 support
•Kotlin support
👇
👇
© 2016 Pivotal Software, Inc. All rights reserved.
Spring Framework 5
•Java 8 baseline, Java 9 compatibility
•Reactive Support & Spring WebFlux
•Router Functions
•Performance improvements
•HTTP/2 support
•Kotlin support
👇
👇
🤔
© 2016 Pivotal Software, Inc. All rights reserved.
© 2016 Pivotal Software, Inc. All rights reserved.
WebMVC + @Controller in Java
@RestController
public class UserController {
private final UserRepository repo;
UserController(UserRepository repo) {/.../}
@GetMapping
List<User> users() {
return repo.findAll();
}
}
© 2016 Pivotal Software, Inc. All rights reserved.
WebFlux + @Controller in Java
@RestController
public class UserController {
private final ReactiveUserRepository repo;
UserController(ReactiveUserRepository repo) {/.../}
@GetMapping
Flux<User> users() {
return repo.findAll();
}
}
© 2016 Pivotal Software, Inc. All rights reserved.
WebFlux + @Controller in Java
@RestController
public class UserController {
private final ReactiveUserRepository repo;
UserController(ReactiveUserRepository repo) {/.../}
@GetMapping
Flux<User> users() {
return repo.findAll();
}
}
Non-Blocking!!
© 2016 Pivotal Software, Inc. All rights reserved.
WebFlux + RouterFunction in Java
© 2016 Pivotal Software, Inc. All rights reserved.
WebFlux + RouterFunction in Java
RouterFunction<?> routes =
route(GET("/users"), req -> ok()
.body(repo.findAll(), User.class));
© 2016 Pivotal Software, Inc. All rights reserved.
WebFlux + RouterFunction in Kotlin
{
accept(APPLICATION_JSON).apply {
GET("/users",{
ok().body(fromPublisher(repo.findAll())
})
}
}
© 2016 Pivotal Software, Inc. All rights reserved.
Check source code!!
• https://github.com/mix-it/mixit
• https://github.com/making/demo-router-functions
© 2016 Pivotal Software, Inc. All rights reserved.
Other Kotlin Support
•Functional Bean Registration with Kotlin
•WebFlux functional API, the Kotlin way
•Leveraging Kotlin nullable information
•Kotlin Script based templates
•...
•https://speakerdeck.com/sdeleuze/functional-
web-applications-with-kotlin-and-spring-5?
© 2016 Pivotal Software, Inc. All rights reserved.
Release date
https://jira.spring.io/browse/SPR
© 2016 Pivotal Software, Inc. All rights reserved.
http://start.spring.io/#!language=kotlin
© 2016 Pivotal Software, Inc. All rights reserved.
http://start.spring.io/#!language=kotlin
© 2016 Pivotal Software, Inc. All rights reserved.
http://start.spring.io/#!language=kotlin
© 2016 Pivotal Software, Inc. All rights reserved.
http://start.spring.io/#!language=kotlin
© 2016 Pivotal Software, Inc. All rights reserved.
Resources
• https://spring.io/blog/2017/01/04/introducing-kotlin-support-
in-spring-framework-5-0
• https://speakerdeck.com/sdeleuze
• https://blog.ik.am/entries/407
© 2016 Pivotal Software, Inc. All rights reserved.
CfP for JJUG CCC 2017 Spring
•Submit Call for Paper!!! 🙇
•http://www.java-users.jp/?p=2830

More Related Content

What's hot

Short Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyoShort Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyoToshiaki Maki
 
Why PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring BootWhy PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring BootToshiaki Maki
 
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyoSpring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyoToshiaki Maki
 
Introduction to Concourse CI #渋谷Java
Introduction to Concourse CI #渋谷JavaIntroduction to Concourse CI #渋谷Java
Introduction to Concourse CI #渋谷JavaToshiaki Maki
 
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3Toshiaki Maki
 
Microservices with Spring and Cloud Foundry
Microservices with Spring and Cloud FoundryMicroservices with Spring and Cloud Foundry
Microservices with Spring and Cloud FoundryAlain Sahli
 
From Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsugFrom Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsugToshiaki Maki
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Toshiaki Maki
 
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...Toshiaki Maki
 
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07Toshiaki Maki
 
今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_kToshiaki Maki
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)Tsuyoshi Miyake
 
Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017VMware Tanzu Korea
 
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tServerless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tToshiaki Maki
 
Spring Cloud Stream with Kafka
Spring Cloud Stream with KafkaSpring Cloud Stream with Kafka
Spring Cloud Stream with KafkaDavid Kiss
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진VMware Tanzu Korea
 
Introduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUGIntroduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUGToshiaki Maki
 
Spring Cloud Netflixを使おう #jsug
Spring Cloud Netflixを使おう #jsugSpring Cloud Netflixを使おう #jsug
Spring Cloud Netflixを使おう #jsugToshiaki Maki
 
Spring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerSpring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerToshiaki Maki
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in RatpackDaniel Woods
 

What's hot (20)

Short Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyoShort Lived Tasks in Cloud Foundry #cfdtokyo
Short Lived Tasks in Cloud Foundry #cfdtokyo
 
Why PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring BootWhy PCF is the best platform for Spring Boot
Why PCF is the best platform for Spring Boot
 
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyoSpring Framework 5.0による Reactive Web Application #JavaDayTokyo
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
 
Introduction to Concourse CI #渋谷Java
Introduction to Concourse CI #渋谷JavaIntroduction to Concourse CI #渋谷Java
Introduction to Concourse CI #渋谷Java
 
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
Event Driven Microservices with Spring Cloud Stream #jjug_ccc #ccc_ab3
 
Microservices with Spring and Cloud Foundry
Microservices with Spring and Cloud FoundryMicroservices with Spring and Cloud Foundry
Microservices with Spring and Cloud Foundry
 
From Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsugFrom Spring Boot 2.2 to Spring Boot 2.3 #jsug
From Spring Boot 2.2 to Spring Boot 2.3 #jsug
 
Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1Introduction to Spring WebFlux #jsug #sf_a1
Introduction to Spring WebFlux #jsug #sf_a1
 
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
#jjug_ccc #ccc_gh5 What's new in Spring Framework 4.3 / Boot 1.4 + Pivotal's ...
 
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
マイクロサービスに必要な技術要素はすべてSpring Cloudにある #DO07
 
今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k今すぐ始めるCloud Foundry #hackt #hackt_k
今すぐ始めるCloud Foundry #hackt #hackt_k
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
 
Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017Spring5 New Features - Nov, 2017
Spring5 New Features - Nov, 2017
 
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1tServerless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
Serverless with Spring Cloud Function, Knative and riff #SpringOneTour #s1t
 
Spring Cloud Stream with Kafka
Spring Cloud Stream with KafkaSpring Cloud Stream with Kafka
Spring Cloud Stream with Kafka
 
SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진SpringOne Platform recap 정윤진
SpringOne Platform recap 정윤진
 
Introduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUGIntroduction to Cloud Foundry #JJUG
Introduction to Cloud Foundry #JJUG
 
Spring Cloud Netflixを使おう #jsug
Spring Cloud Netflixを使おう #jsugSpring Cloud Netflixを使おう #jsug
Spring Cloud Netflixを使おう #jsug
 
Spring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & MicrometerSpring Boot Actuator 2.0 & Micrometer
Spring Boot Actuator 2.0 & Micrometer
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in Ratpack
 

Similar to Spring ❤️ Kotlin #jjug

How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsSufyaan Kazi
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegelermfrancis
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]David Buck
 
What's new in the Java API for JSON Binding
What's new in the Java API for JSON BindingWhat's new in the Java API for JSON Binding
What's new in the Java API for JSON BindingDmitry Kornilov
 
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D BosschaertLeveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaertmfrancis
 
Best practices iOS meetup - pmd
Best practices iOS meetup - pmdBest practices iOS meetup - pmd
Best practices iOS meetup - pmdSuyash Gupta
 
Configuration for Java EE and the Cloud
Configuration for Java EE and the CloudConfiguration for Java EE and the Cloud
Configuration for Java EE and the CloudDmitry Kornilov
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaAtlassian
 
Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_aioughydchapter
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureJavaDayUA
 
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světě
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světěJaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světě
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světěDevelcz
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
All You Need is Structure
All You Need is StructureAll You Need is Structure
All You Need is StructureLavaCon
 
IMMERSE'16 Introduction to adobe experience manager back end
IMMERSE'16 Introduction to adobe experience manager back endIMMERSE'16 Introduction to adobe experience manager back end
IMMERSE'16 Introduction to adobe experience manager back endAdobeMarketingCloud
 
Manchester geek night pcf 101
Manchester geek night   pcf 101Manchester geek night   pcf 101
Manchester geek night pcf 101Sufyaan Kazi
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...All Things Open
 
Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Carl Brown
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTNaresh Jain
 
Using Spring with Scala
Using Spring with ScalaUsing Spring with Scala
Using Spring with ScalaBernhardWenzel
 

Similar to Spring ❤️ Kotlin #jjug (20)

How to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native ApplicationsHow to Architect and Develop Cloud Native Applications
How to Architect and Develop Cloud Native Applications
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
 
What's new in the Java API for JSON Binding
What's new in the Java API for JSON BindingWhat's new in the Java API for JSON Binding
What's new in the Java API for JSON Binding
 
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D BosschaertLeveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
Leveraging the Latest OSGi R7 Specifications - C Ziegeler & D Bosschaert
 
Best practices iOS meetup - pmd
Best practices iOS meetup - pmdBest practices iOS meetup - pmd
Best practices iOS meetup - pmd
 
Configuration for Java EE and the Cloud
Configuration for Java EE and the CloudConfiguration for Java EE and the Cloud
Configuration for Java EE and the Cloud
 
Declaring Server App Components in Pure Java
Declaring Server App Components in Pure JavaDeclaring Server App Components in Pure Java
Declaring Server App Components in Pure Java
 
Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and Architecture
 
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světě
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světěJaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světě
Jaroslav Tulach: GraalVM - z vývoje nejrychlejšího virtuálního stroje na světě
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
All You Need is Structure
All You Need is StructureAll You Need is Structure
All You Need is Structure
 
IMMERSE'16 Introduction to adobe experience manager back end
IMMERSE'16 Introduction to adobe experience manager back endIMMERSE'16 Introduction to adobe experience manager back end
IMMERSE'16 Introduction to adobe experience manager back end
 
Manchester geek night pcf 101
Manchester geek night   pcf 101Manchester geek night   pcf 101
Manchester geek night pcf 101
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...
 
Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016Swift 2.2 Design Patterns CocoaConf Austin 2016
Swift 2.2 Design Patterns CocoaConf Austin 2016
 
Unleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDTUnleashing the Power of Automated Refactoring with JDT
Unleashing the Power of Automated Refactoring with JDT
 
Compose Camp Session 1.pdf
Compose Camp Session 1.pdfCompose Camp Session 1.pdf
Compose Camp Session 1.pdf
 
Using Spring with Scala
Using Spring with ScalaUsing Spring with Scala
Using Spring with Scala
 

More from Toshiaki Maki

決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1Toshiaki Maki
 
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1Toshiaki Maki
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpToshiaki Maki
 
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoBOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoToshiaki Maki
 
Zipkin Components #zipkin_jp
Zipkin Components #zipkin_jpZipkin Components #zipkin_jp
Zipkin Components #zipkin_jpToshiaki Maki
 
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...Toshiaki Maki
 
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techConsumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techToshiaki Maki
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoToshiaki Maki
 
Concourse CI Meetup Demo
Concourse CI Meetup DemoConcourse CI Meetup Demo
Concourse CI Meetup DemoToshiaki Maki
 
Install Concourse CI with BOSH
Install Concourse CI with BOSHInstall Concourse CI with BOSH
Install Concourse CI with BOSHToshiaki Maki
 

More from Toshiaki Maki (10)

決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
決済システムの内製化への旅 - SpringとPCFで作るクラウドネイティブなシステム開発 #jsug #sf_h1
 
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
Spring Boot Actuator 2.0 & Micrometer #jjug_ccc #ccc_a1
 
Open Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjpOpen Service Broker APIとKubernetes Service Catalog #k8sjp
Open Service Broker APIとKubernetes Service Catalog #k8sjp
 
BOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyoBOSH / CF Deployment in modern ways #cf_tokyo
BOSH / CF Deployment in modern ways #cf_tokyo
 
Zipkin Components #zipkin_jp
Zipkin Components #zipkin_jpZipkin Components #zipkin_jp
Zipkin Components #zipkin_jp
 
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
 
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3techConsumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
Consumer Driven Contractsで REST API/マイクロサービスをテスト #m3tech
 
Implement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyoImplement Service Broker with Spring Boot #cf_tokyo
Implement Service Broker with Spring Boot #cf_tokyo
 
Concourse CI Meetup Demo
Concourse CI Meetup DemoConcourse CI Meetup Demo
Concourse CI Meetup Demo
 
Install Concourse CI with BOSH
Install Concourse CI with BOSHInstall Concourse CI with BOSH
Install Concourse CI with BOSH
 

Recently uploaded

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Spring ❤️ Kotlin #jjug

  • 1. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Spring ❤ Kotlin Toshiaki Maki (@making) tmaki@pivotal.io JJUG Night Seminar 2017 Feb 2017-02-20
  • 2. © 2016 Pivotal Software, Inc. All rights reserved. Who am I ? • Toshiaki Maki (@making) https://ik.am • Sr. Solutions Architect @Pivotal • Spring ☘ / Cloud Foundry ☁ / Concourse ✈ / BOSH 🐚 bit.ly/hajiboot2
  • 3. © 2016 Pivotal Software, Inc. All rights reserved. Agenda •Spring Boot with Kotlin •Kotlin support in Spring 5
  • 4. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Spring Boot with Kotlin
  • 5. © 2016 Pivotal Software, Inc. All rights reserved. Spring Initializr
  • 6. © 2016 Pivotal Software, Inc. All rights reserved. Spring Initializr
  • 7. © 2016 Pivotal Software, Inc. All rights reserved.
  • 8. © 2016 Pivotal Software, Inc. All rights reserved.
  • 9. © 2016 Pivotal Software, Inc. All rights reserved.
  • 10. © 2016 Pivotal Software, Inc. All rights reserved.
  • 11. © 2016 Pivotal Software, Inc. All rights reserved.
  • 12. © 2016 Pivotal Software, Inc. All rights reserved.
  • 13. © 2016 Pivotal Software, Inc. All rights reserved.
  • 14. © 2016 Pivotal Software, Inc. All rights reserved. package com.example
 
 import org.springframework.boot.SpringApplication
 import org.springframework.boot.autoconfigure.SpringBootApplication
 
 @SpringBootApplication
 class DemoApplication
 
 fun main(args: Array<String>) {
 SpringApplication.run(DemoApplication::class.java, *args)
 }

  • 15. © 2016 Pivotal Software, Inc. All rights reserved.
  • 16. © 2016 Pivotal Software, Inc. All rights reserved. package com.example
 
 import org.springframework.web.bind.annotation.GetMapping
 import org.springframework.web.bind.annotation.RestController
 
 @RestController
 class HelloController {
 @GetMapping("/")
 fun hello() = "Hello World!"
 } 

  • 17. © 2016 Pivotal Software, Inc. All rights reserved. package com.example
 
 import org.springframework.web.bind.annotation.GetMapping
 import org.springframework.web.bind.annotation.RestController
 
 @RestController
 class HelloController {
 @GetMapping("/")
 fun hello() = "Hello World!"
 } 

  • 18. © 2016 Pivotal Software, Inc. All rights reserved. // Kotlin open class AppConfig {
 @Bean
 open fun restTemplate() = RestTemplate()
 }
  • 19. © 2016 Pivotal Software, Inc. All rights reserved. // Kotlin open class AppConfig {
 @Bean
 open fun restTemplate() = RestTemplate()
 } 👇 👇
  • 20. © 2016 Pivotal Software, Inc. All rights reserved. // Kotlin open class AppConfig {
 @Bean
 open fun restTemplate() = RestTemplate()
 } 👇 👇 😩
  • 21. © 2016 Pivotal Software, Inc. All rights reserved. Cglib and Spring // Java class AppConfig {
 @Bean
 RestTemplate restTemplate() { return new RestTemplate(); }
 }
  • 22. © 2016 Pivotal Software, Inc. All rights reserved. Cglib and Spring // Java class AppConfig {
 @Bean
 RestTemplate restTemplate() { return new RestTemplate(); }
 } Singleton
  • 23. © 2016 Pivotal Software, Inc. All rights reserved. Cglib and Spring (Pseudo Code) class AppConfig$$ extends AppConfig { @Override
 RestTemplate restTemplate() { if (context.contains("restTemplate")) { return context.get("restTemplate"); } return super.restTemplate(); }
 }
  • 24. © 2016 Pivotal Software, Inc. All rights reserved. Cglib and Spring (Pseudo Code) class AppConfig$$ extends AppConfig { @Override
 RestTemplate restTemplate() { if (context.contains("restTemplate")) { return context.get("restTemplate"); } return super.restTemplate(); }
 } Methods in Kotlin are final by default !! open removes final
  • 25. © 2016 Pivotal Software, Inc. All rights reserved. <plugin>
 <artifactId>kotlin-maven-plugin</artifactId>
 <groupId>org.jetbrains.kotlin</groupId>
 <version>${kotlin.version}</version>
 <configuration>
 <compilerPlugins>
 <plugin>spring</plugin>
 </compilerPlugins>
 </configuration> </plugin>
  • 26. © 2016 Pivotal Software, Inc. All rights reserved. open class AppConfig {
 @Bean
 open fun restTemplate() = RestTemplate()
 }
  • 27. © 2016 Pivotal Software, Inc. All rights reserved. open class AppConfig {
 @Bean
 open fun restTemplate() = RestTemplate()
 }
  • 28. © 2016 Pivotal Software, Inc. All rights reserved. class AppConfig {
 @Bean
 fun restTemplate() = RestTemplate()
 }
  • 29. © 2016 Pivotal Software, Inc. All rights reserved. class AppConfig {
 @Bean
 fun restTemplate() = RestTemplate()
 } 😍
  • 30. © 2016 Pivotal Software, Inc. All rights reserved. http://start.spring.io/#!language=kotlin
  • 31. ‹#›© 2016 Pivotal Software, Inc. All rights reserved. Kotlin support in Spring 5
  • 32. © 2016 Pivotal Software, Inc. All rights reserved. Spring Framework 5 •Java 8 baseline, Java 9 compatibility •Reactive Support & Spring WebFlux •Router Functions •Performance improvements •HTTP/2 support •Kotlin support
  • 33. © 2016 Pivotal Software, Inc. All rights reserved. Kotlin Support
  • 34. © 2016 Pivotal Software, Inc. All rights reserved. Kotlin Support
  • 35. © 2016 Pivotal Software, Inc. All rights reserved. Kotlin Support •Extension Functions •Reified type parameters
  • 36. © 2016 Pivotal Software, Inc. All rights reserved. Kotlin Support •Extension Functions •Reified type parameters 🤔
  • 37. © 2016 Pivotal Software, Inc. All rights reserved. package com.example; public class Foo { public <T> T create(Class<T> clazz) { try { return clazz.newInstance(); } catch (Exception e) { throw new IllegalStateException(e); } } }
  • 38. © 2016 Pivotal Software, Inc. All rights reserved. // Java Foo foo = new Foo(); Bar bar = foo.create(Bar.class);
  • 39. © 2016 Pivotal Software, Inc. All rights reserved. // Java Foo foo = new Foo(); Bar bar = foo.create(Bar.class); // Kotlin val foo = Foo() val bar = foo.create(Bar::class.java)
  • 40. © 2016 Pivotal Software, Inc. All rights reserved. // Java Foo foo = new Foo(); Bar bar = foo.create(Bar.class); // Kotlin val foo = Foo() val bar = foo.create(Bar::class.java) 👇
  • 41. © 2016 Pivotal Software, Inc. All rights reserved. KClass Bar::class // kotlin.reflect.KClass Bar::class.java // java.lang.Class

  • 42. © 2016 Pivotal Software, Inc. All rights reserved. Extension Functions •Extends a class with new functionality without having to inherit from the class •https://kotlinlang.org/docs/reference/ extensions.html#extension-functions
  • 43. © 2016 Pivotal Software, Inc. All rights reserved. // Kotlin val foo = Foo() val bar = foo.create(Bar::class.java)
  • 44. © 2016 Pivotal Software, Inc. All rights reserved. // Kotlin val foo = Foo() val bar = foo.create(Bar::class.java)
  • 45. © 2016 Pivotal Software, Inc. All rights reserved. // Kotlin val foo = Foo() val bar = foo.create(Bar::class)
  • 46. © 2016 Pivotal Software, Inc. All rights reserved. Extension Functions // Kotlin val foo = Foo() val bar = foo.create(Bar::class)
  • 47. © 2016 Pivotal Software, Inc. All rights reserved. Extension Functions package com.example import kotlin.reflect.KClass fun <T : Any> Foo.create(kclass: KClass<T>) = create(kclass.java)
 FooExtensions.kt
  • 48. © 2016 Pivotal Software, Inc. All rights reserved. Extension Functions package com.example import kotlin.reflect.KClass fun <T : Any> Foo.create(kclass: KClass<T>) = create(kclass.java)
 👇 FooExtensions.kt
  • 49. © 2016 Pivotal Software, Inc. All rights reserved. Extension Functions // Kotlin val foo = Foo() val bar = foo.create(Bar::class) 😍
  • 50. © 2016 Pivotal Software, Inc. All rights reserved. Reified type parameters •Access a type passed to us as a parameter •https://kotlinlang.org/docs/reference/inline- functions.html#reified-type-parameters
  • 51. © 2016 Pivotal Software, Inc. All rights reserved. Reified type parameters inline fun <reified T : Any> Foo.create() = create(T::class.java)

  • 52. © 2016 Pivotal Software, Inc. All rights reserved. Reified type parameters inline fun <reified T : Any> Foo.create() = create(T::class.java)
👇 👇
  • 53. © 2016 Pivotal Software, Inc. All rights reserved. val foo = Foo() val bar = foo.create(Bar::class)

  • 54. © 2016 Pivotal Software, Inc. All rights reserved. val foo = Foo() val bar = foo.create(Bar::class)

  • 55. © 2016 Pivotal Software, Inc. All rights reserved. Reified type parameters val foo = Foo() val bar = foo.create<Bar>()
 😍
  • 56. © 2016 Pivotal Software, Inc. All rights reserved. Reified type parameters val foo = Foo() val bar: Bar = foo.create()
 😍
  • 57. © 2016 Pivotal Software, Inc. All rights reserved. Reified type parameters val foo = Foo() val bar: Bar = foo.create()
 😍 "idiomatic Kotlin code"
  • 58. © 2016 Pivotal Software, Inc. All rights reserved. "idiomatic Kotlin code" with Spring 5
  • 59. © 2016 Pivotal Software, Inc. All rights reserved. Application Context // Java ApplicationContext context = ...; Bar bar = context.getBean(Bar.class);
  • 60. © 2016 Pivotal Software, Inc. All rights reserved. Application Context (Extension) // Kotlin val context = ... val bar = context.getBean(Bar::class)

  • 61. © 2016 Pivotal Software, Inc. All rights reserved. Application Context (Reified Type) // Kotlin val context = ... val bar = context.getBean<Bar>()

  • 62. © 2016 Pivotal Software, Inc. All rights reserved. Application Context (Reified Type) // Kotlin val context = ... val bar: Bar = context.getBean()

  • 63. © 2016 Pivotal Software, Inc. All rights reserved. JdbcTemplate // Java Long count = jdbcTemplate .queryForObject("SELECT count(*) FROM foo" , Long.class);
  • 64. © 2016 Pivotal Software, Inc. All rights reserved. JdbcTemplate (Extension) // Kotlin val count = jdbcTemplate .queryForObject("SELECT count(*) FROM foo" , Long::class)
  • 65. © 2016 Pivotal Software, Inc. All rights reserved. JdbcTemplate (Reified Type) // Kotlin val count = jdbcTemplate .queryForObject<Long>( "SELECT count(*) FROM foo")
  • 66. © 2016 Pivotal Software, Inc. All rights reserved. JdbcTemplate (Reified Type) // Kotlin val count: Long = jdbcTemplate .queryForObject("SELECT count(*) FROM foo")
  • 67. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate // Java String foo = restTemplate .getForObject("http://abc.io",String.class);
  • 68. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate (Reified Type) // Kotlin val foo = restTemplate .getForObject<String>("http://abc.io");
  • 69. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate (Reified Type) // Kotlin val foo: String = restTemplate .getForObject("http://abc.io");
  • 70. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate // Java List<Foo> foos = restTemplate .getForObject("http://abc.io", List<Foo>.class);
  • 71. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate // Java List<Foo> foos = restTemplate .getForObject("http://abc.io", List<Foo>.class); Compile Error!
  • 72. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate // Java List<Foo> foos = restTemplate .exchange("http://abc.io", HttpMethod.GET, null, new ParameterizedTypeReference<List<Foo>>() {}).getBody();
  • 73. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate // Java List<Foo> foos = restTemplate .exchange("http://abc.io", HttpMethod.GET, null, new ParameterizedTypeReference<List<Foo>>() {}).getBody(); 💩
  • 74. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate (Reified Type)
  • 75. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate (Reified Type) // Kotlin val foos: List<Foo> = restTemplate .getForObject("http://abc.io");
  • 76. © 2016 Pivotal Software, Inc. All rights reserved. RestTemplate (Reified Type) // Kotlin val foos: List<Foo> = restTemplate .getForObject("http://abc.io"); 😍
  • 77. © 2016 Pivotal Software, Inc. All rights reserved. Spring ❤ Kotlin
  • 78. © 2016 Pivotal Software, Inc. All rights reserved. Spring Framework 5 •Java 8 baseline, Java 9 compatibility •Reactive Support & Spring WebFlux •Router Functions •Performance improvements •HTTP/2 support •Kotlin support
  • 79. © 2016 Pivotal Software, Inc. All rights reserved. Spring Framework 5 •Java 8 baseline, Java 9 compatibility •Reactive Support & Spring WebFlux •Router Functions •Performance improvements •HTTP/2 support •Kotlin support 👇 👇
  • 80. © 2016 Pivotal Software, Inc. All rights reserved. Spring Framework 5 •Java 8 baseline, Java 9 compatibility •Reactive Support & Spring WebFlux •Router Functions •Performance improvements •HTTP/2 support •Kotlin support 👇 👇 🤔
  • 81. © 2016 Pivotal Software, Inc. All rights reserved.
  • 82. © 2016 Pivotal Software, Inc. All rights reserved. WebMVC + @Controller in Java @RestController public class UserController { private final UserRepository repo; UserController(UserRepository repo) {/.../} @GetMapping List<User> users() { return repo.findAll(); } }
  • 83. © 2016 Pivotal Software, Inc. All rights reserved. WebFlux + @Controller in Java @RestController public class UserController { private final ReactiveUserRepository repo; UserController(ReactiveUserRepository repo) {/.../} @GetMapping Flux<User> users() { return repo.findAll(); } }
  • 84. © 2016 Pivotal Software, Inc. All rights reserved. WebFlux + @Controller in Java @RestController public class UserController { private final ReactiveUserRepository repo; UserController(ReactiveUserRepository repo) {/.../} @GetMapping Flux<User> users() { return repo.findAll(); } } Non-Blocking!!
  • 85. © 2016 Pivotal Software, Inc. All rights reserved. WebFlux + RouterFunction in Java
  • 86. © 2016 Pivotal Software, Inc. All rights reserved. WebFlux + RouterFunction in Java RouterFunction<?> routes = route(GET("/users"), req -> ok() .body(repo.findAll(), User.class));
  • 87. © 2016 Pivotal Software, Inc. All rights reserved. WebFlux + RouterFunction in Kotlin { accept(APPLICATION_JSON).apply { GET("/users",{ ok().body(fromPublisher(repo.findAll()) }) } }
  • 88. © 2016 Pivotal Software, Inc. All rights reserved. Check source code!! • https://github.com/mix-it/mixit • https://github.com/making/demo-router-functions
  • 89. © 2016 Pivotal Software, Inc. All rights reserved. Other Kotlin Support •Functional Bean Registration with Kotlin •WebFlux functional API, the Kotlin way •Leveraging Kotlin nullable information •Kotlin Script based templates •... •https://speakerdeck.com/sdeleuze/functional- web-applications-with-kotlin-and-spring-5?
  • 90. © 2016 Pivotal Software, Inc. All rights reserved. Release date https://jira.spring.io/browse/SPR
  • 91. © 2016 Pivotal Software, Inc. All rights reserved. http://start.spring.io/#!language=kotlin
  • 92. © 2016 Pivotal Software, Inc. All rights reserved. http://start.spring.io/#!language=kotlin
  • 93. © 2016 Pivotal Software, Inc. All rights reserved. http://start.spring.io/#!language=kotlin
  • 94. © 2016 Pivotal Software, Inc. All rights reserved. http://start.spring.io/#!language=kotlin
  • 95. © 2016 Pivotal Software, Inc. All rights reserved. Resources • https://spring.io/blog/2017/01/04/introducing-kotlin-support- in-spring-framework-5-0 • https://speakerdeck.com/sdeleuze • https://blog.ik.am/entries/407
  • 96. © 2016 Pivotal Software, Inc. All rights reserved. CfP for JJUG CCC 2017 Spring •Submit Call for Paper!!! 🙇 •http://www.java-users.jp/?p=2830