@@ -31,10 +31,9 @@ https://start.spring.io/#!language=kotlin[start.spring.io].
3131[[extensions]]
3232== Extensions
3333
34- Thanks to its great https://kotlinlang.org/docs/reference/java-interop.html[Java interoperability]
35- and to https://kotlinlang.org/docs/reference/extensions.html[Kotlin extensions], Spring
36- Framework Kotlin APIs leverage regular Java APIs and are additionally enhanced by a few Kotlin specific APIs
37- available out of the box within Spring Framework 5 artifacts.
34+ Kotlin https://kotlinlang.org/docs/reference/extensions.html[extensions] provide the ability
35+ to extend existing classes with additional functionality. The Spring Framework Kotlin APIs make
36+ use of these extensions to add new Kotlin specific conveniences to existing Spring APIs.
3837
3938{doc-root}/spring-framework/docs/{spring-version}/kdoc-api/spring-framework/[Spring Framework KDoc API] lists
4039and documents all the Kotlin extensions and DSLs available.
@@ -343,11 +342,11 @@ Whilst Kotlin's JVM-friendly design is generally frictionless with Spring,
343342this specific Kotlin feature can prevent the application from starting, if this fact is not taken in
344343consideration. This is because Spring beans are normally proxified with CGLIB
345344- such as `@Configuration` classes - which need to be inherited at runtime for technical reasons.
345+ The workaround was to add an `open` keyword on each class and member
346+ functions of Spring beans proxified with CGLIB such as `@Configuration` classes, which can
347+ quickly become painful and is against Kotlin principle to keep code concise and predictable.
346348
347- Before Kotlin 1.0.6, one needed to add an `open` keyword on each class and member
348- functions of Spring beans proxified with CGLIB such as `@Configuration` classes.
349-
350- Fortunately, Kotlin 1.0.6+ now provides a
349+ Fortunately, Kotlin now provides a
351350https://kotlinlang.org/docs/reference/compiler-plugins.html#kotlin-spring-compiler-plugin[`kotlin-spring`]
352351plugin, a preconfigured version of `kotlin-allopen` plugin that automatically opens classes
353352and their member functions for types annotated or meta-annotated with one of the following
@@ -362,7 +361,8 @@ Meta-annotations support means that types annotated with `@Configuration`, `@Con
362361`@RestController`, `@Service` or `@Repository` are automatically opened since these
363362annotations are meta-annotated with `@Component`.
364363
365- http://start.spring.io/#!language=kotlin[start.spring.io] enables it by default.
364+ http://start.spring.io/#!language=kotlin[start.spring.io] enables it by default, so in practice
365+ you will be able to write your Kotlin beans without any additional `open` keyword, like in Java.
366366
367367=== Using immutable class instances for persistence
368368
0 commit comments