Protocol Oriented Programming using Kotlin
Submitted by Manas Chaudhari (@manas-chaudhari) on Monday, 19 September 2016
Section: Crisp talk (15 minutes) Technical level: Advanced
In OOP, inheritance is the mechanism used to share code. Because of lack of multiple inheritance, it is common to end up building God objects with all the functionality.
Protocol Oriented Programming (POP) is an upcoming paradigm which tackles this problem. Idea is to think of everything as an interface (vs class in OOP). POP relies heavily on writing extension functions. Everything is written as an interface and functionality is implemented through extension methods on these interfaces.
As Kotlin provides the extension functions feature, it is excellent for Protocol Oriented Programming. In fact, most of the code of the Kotlin IntelliJ plugin (written in Kotlin) is protocol oriented.
This session is intended for all programmers interested in learning a new way to code.
- Protocol Oriented Programming
- Extension Functions in Kotlin
- Problem with inheritance
- Solution using POP
- Applications in Android Development
Graduating from IIT Bombay in 2014, Manas Chaudhari joined TinyOwl and built the consumer Android and iOS apps. Currently, he drives the consumer product at TinyOwl/Runnr, leading a team of Android, iOS and backend (ROR) devs. His core focus is to make development faster and bug-free.
As a Microsoft Student Partner, he developed Windows Phone apps and conducted workshops in nearby colleges.