Created
February 7, 2019 09:29
-
-
Save timvw/0e2d106492f1787c92dbaac620c0f3fd to your computer and use it in GitHub Desktop.
Demonstrating cake pattern
This file contains 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
trait IHaveLakeName { | |
def lakeName: String | |
} | |
trait IHaveStreamName { | |
def streamName: String | |
} | |
trait IHaveLakeAndStreamName extends IHaveLakeName with IHaveStreamName | |
trait CheckpointNameFromLakeAndStream extends HasCheckpointName { self: IHaveLakeName with IHaveStreamName => | |
override def checkpointName: String = s"${lakeName}_${streamName}" | |
} | |
class MyPuddle extends IHaveLakeName with IHaveStreamName with CheckpointNameFromLakeAndStream { | |
override def lakeName: String = "awesome" | |
override def streamName: String = "data" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment