Skip to content

Instantly share code, notes, and snippets.

@jeanPokou
Last active November 10, 2018 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeanPokou/4e4956a99f50bb091914e7bd822bc544 to your computer and use it in GitHub Desktop.
Save jeanPokou/4e4956a99f50bb091914e7bd822bc544 to your computer and use it in GitHub Desktop.
Main class for Observer Pattern
fun main() {
// we create a speaker
val speaker = Speaker()
// we add three audiences to the speaker
speaker.addAudience(audience = Audience())
speaker.addAudience(audience = Audience())
speaker.addAudience(audience = Audience())
// set the message
speaker.setMessage("Hello People!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment