#1 @Autowired and how to subclass methods in Kotlin
- Since Spring Framework version 4.3 the @Autowired annotation can be omitted on the constructor of a Spring bean, as long as it only defines a single constructor. When defining multiple constructors you still need to mark one with the @Autowired annotation.
- In Kotlin it is possible to subclass methods:
- class Subclass(val name: String) : () -> String {
- override fun invoke(): String {
- return name
- }
- }