Skip to Content
Spring 5.0 Projects
book

Spring 5.0 Projects

by Nilang Patel
February 2019
Intermediate to advanced
442 pages
11h 46m
English
Packt Publishing
Content preview from Spring 5.0 Projects

Extension functions

If you need to extend a class with a set of new functionalities, you need to update the Java source code. However, if you are using third-party libraries, you may not have the source. A class needs to be extended to accommodate other functions. You also can use various design patterns such as decorator and strategy for this purpose.

However, Kotlin allows the straightforward adding of extra functions to an existing class with the feature called an extension function. As its name implies, an extension function extends the functionality of the class without touching its source code. In other words, you are no longer required to inherit the class to be extended. This sounds really interesting. It behaves just like other member ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Spring Boot 2.0 Projects

Spring Boot 2.0 Projects

Mohamed Shazin Sadakath
Spring 5.0 By Example

Spring 5.0 By Example

Claudio Eduardo de Oliveira
Spring 5.0 Cookbook

Spring 5.0 Cookbook

Sherwin John C. Tragura
Pro Spring 5: An In-Depth Guide to the Spring Framework and Its Tools

Pro Spring 5: An In-Depth Guide to the Spring Framework and Its Tools

Iuliana Cosmina, Rob Harrop, Chris Schaefer, Clarence Ho

Publisher Resources

ISBN: 9781788390415Supplemental Content