A programming language supporting object-oriented programming and functional programming. Its traits support reusable mixin behavior, while type variance controls how parameterized types participate in subtyping. The Scala 2 and Scala 3 language versions differ in some syntax and typing details; examples should state the version relevant to a particular claim. Official documentation: docs.scala-lang.org
Scala Swing provides Scala wrappers for Java Swing graphical user interfaces. Its notification mechanism implements an observer pattern: a publisher emits software events, and a reactor subscribes with listenTo(publisher). Adding a handler to reactions supplies a partial function that matches the software events the reactor handles. Subscription and handling are distinct: one determines which publisher is heard, and the other determines what to do with a matching notification.[ref]
For example, a button publishes a button-click notification, and a subscribed display component handles it by updating a label. Another publisher's notifications need a subscription of their own. Calling deafTo(publisher) ends the subscription to that publisher without requiring removal of every handler.[ref]

Ancestors (3)

  1. Programming language
  2. Computer science
  3. Home

Discussion (0) New discussion

There are no discussions about this article yet.

Articles by others on the same topic (0)

There are currently no matching articles.