Abstract

Abstract—Kotlin has many features that make code simpler to develop and read. One such feature is the support for extension functions. Extension functions allow extending the capability of a class or interface, without the need for coding pattern like the decorator pattern and utilities, which add a lot of complexity to code. In this paper we study the decorator pattern which is the primary tool used for class extension. We discuss the disadvantages of using the decorator pattern and how extensions can be used to overcome them. We review how extensions work and how they can used. Finally, we present some benefits and drawbacks of extension functions. Keywords—decorator pattern, class extension, code readability, code reuse

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.