@seflorentino
Full StackOverflow Developer
Full Stack Overflow developers work almost entirely by copying and pasting code from Stack Overflow instead of understanding what they are doing. Instead of researching a topic, they go there first to ask a question hoping people will just give them the result. - Christian Heilmann
Nothing here yet.
No blogs yet.
Right on. You want to get rid of hard dependencies between modules and instead have a contract between them (messaging/interfaces/traits). I think having a logical dependency diagram will help you in defining that contract, e.g. you probably want a contract that will work for all modules that do damage and for that you will need to know what those modules are and how their dependencies may affect the contract design.
My $0.02: If your classes don't need state, don't add state. Make OOP work for you, not the other way around. I would probably use static methods in your example. Create a Salad class that models the output of SaladMaker. See if that helps with return values.
Edited--op is asking about Higher-kinded Type (HKT) and not higher order type. AFAIK there is not any language-level support for HKT in Kotlin. Maybe someday? https://github.com/Kotlin/KEEP/pull/87 _Original Response: Have a look at https://en.wikipedia.org/wiki/Higher-order_function. There is a section there for Kotlin._