Allan Caine
1 min readOct 21, 2018

--

I really enjoyed reading your article. I went through it writing out your code. I agree with Alexander Kosenkov’s comment. I found it easier to simply write

employee {
name = "David"
id = "343"
title = "Super Boss"
salary = 32332223

}

So, the builder is simplified to:

class EmployeeBuilder {
var name: String = ""
var id: String = ""
var title: String = ""
var salary: Int = 0

fun build() = Employee(name, id, title, salary)

}

I liked your idea of the EmployeeListBuilder. It is a good idea. Then all of the employee declarations must appear inside the employeesblock. It helps to keep the declarations more organized.

Thank you for your well-written article.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Allan Caine
Allan Caine

Written by Allan Caine

Senior Android Developer, TD Bank (Canada) (Opinions are my own)

No responses yet

Write a response