Constructors are regular functions that give a chance to developer to initialise state of class instance. They are completely optional, and it's perfectly valid to have this, although not so useful 😃
10 posts tagged with "kotlin"
View All TagsDecorator pattern in kotlin
If you feel curious how would an implementation of decorator design pattern look like in Kotlin, this might be the right place for you. This example is just a very basic thing that you then tweak until it’s perfect. Pattern definition can be found at Wiki, but what’s important is that you can compose chain of decorators at runtime and in such a way – you can control runtime behavior of your system.
Extension functions in kotlin
Kotlin language recently gained some traction owing to Google promoting it as a primary language for writing android apps. Kotlin has already been for a while in production owing to it’s creator JetBrains incorporating it in own tools, such as Intellij IDEA and so forth.
Factory method pattern in Kotlin
Kotlin
language can come quite handy write concise and expressive code, without too much boilerplate, while keeping all advantages of being JVM
citizen. Let's quickly peek
into example of creating Factory
method creational design pattern implementation.
Kotlin powered Spring Boot app consuming NBA Rest Api
Ladies and gents, once again I’m sharing some sample app, this time we are building sample Spring Boot app implemented in Kotlin, talking to http://data.nba.net/ API to help us get some interesting, NBA related data. In this case we’re just listing NBA teams, but you extend this sample even further.
Microservices with Spring Boot, Netflix Zuul, Kotlin, Docker and MongoDB
Recently I've started playing with Kotlin programming language, and wanted to give it a try. Kotlin gives us possibility to write quite concise code.
Sending mail via GMail using Kotlin and commons-mail library
Continuing series of blog posts related to Kotlin
, today we’ll together make a sample application showing us how we could automate
email sending – using Kotlin
programming language. Example is quite simple, and surely – you can enhance it with own features. Application
mostly demonstrates compact Kotlin
syntax, as well as full compatibility with Java or 3rd party libraries (in this case Apache commons-mail
library).
Zero boilerplate implementing state pattern in kotlin
State pattern is a pretty nice solution for solving problems related to changing behavior of some component(class) at runtime, which varies depending on current state of that object.
Strategy pattern example using kotlin scripts
I thought it would be nice to use advantages of Kotlin
language to showcase strategy pattern implementation. In order to get the example
running – we need to install kotlin binaries (installation). I’m running simple Kotlin
script in this example.
Why Kotlin?
In this, relatively short post, I’ll try to cover some aspects of programming in Kotlin programming language that may give you a better context when deciding upon whether you may like to use it for your next project.
Let’s get started.