How to Hidden Temporal Couplings / In Kotlin and Android

override fun bakeOne(menu: MENU): Dish {
this.selectedMenu = menu
prepareIngredients() // Prepare the "Mise en place".
prepareDough()
// Prepare the dough.
prepareSauce()
// Prepare the sauce.
topDough()
// Top dough with the sauce.

return bake()
}
override fun bakeOne(menu: MENU): Dish {
val selectedMenu = menu
val ingredients = prepareIngredients(selectedMenu)
val dough = prepareDough(ingredients)
val sauce = prepareSauce(ingredients)
topDough(dough, sauce)


return bake(dough)
}

in Android,

    initToolbarTitle()
initBreadcrumb()
initListOfElements()
initCloseButton()
initSearchExperience()
collectDataAndSubmit()
val listOfInitTaskForTheView = arrayListOf(
initToolbarTitle,
initBreadcrumb,
initListOfElements,
initCloseButton,
initSearchExperience,
collectDataAndSubmit
)
listOfInitTaskForTheView.forEach { it.invoke() }
private val initToolbarTitle = { // Do something. }

Engineering | Agile | Climbing | Travelling

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Creation of RocketBot

implementation of 3D Touch in iOS

How to Approach Recursive Solutions

AWS: What is Amazon EBS? What can affect its pricing?

Twice removed.

How I Learned to Love the GIS Challenge

Key Takeaways from Building a PC

Dynamic Programming in Golang

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nicolas Quartieri

Nicolas Quartieri

Engineering | Agile | Climbing | Travelling

More from Medium

Reactdroid — Reactive MVI Architecture for Android — Part 3

TDD — Part I, Theory

Filter pattern: kobiri’s parser pipeline

Concurrent Modification Exception-Android