Created
September 7, 2017 14:25
-
-
Save caseykulm/12e7f0a5bf0043b704acf94971842a8a to your computer and use it in GitHub Desktop.
Inject Functions: 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface TreatFactory { | |
fun getTreats(): Treats | |
} | |
class PetsMart: TreatFactory { | |
fun getTreats(): Treats { | |
// Petsmart details | |
} | |
} | |
class HoomansBed: TreatFactory { | |
fun getTreats(): Treats { | |
// look under the pillows | |
} | |
} | |
val treatFactory1 = PetsMart() | |
val treatFactory2 = HoomansBed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment