December 2017
Intermediate to advanced
260 pages
7h 34m
English
In Spring, we register our beans either using XML or the @Configuration and @Bean annotations. When Spring Boot is used from Kotlin, there is a new alternative to declare the beans using lambdas, which act as FactoryBean.
Registering beans in Java:
GenericApplicationContext context = new GenericApplicationContext(); context.registerBean(Message.class);
With DSL style and reified type parameters, the Kotlin equivalent is as simple and beautiful as the following:
beans { bean<Message>() }
Now that we understand the key constructs of Kotlin while building Spring Boot applications, let's move on to the example application.
Read now
Unlock full access