Scala is short for Scalable Language. It smoothly integrates features of object-oriented and functional languages and its syntax is similar to Java. It has a very tight integration with Java and its byte code runs on the JVM.
Resources:
Observer pattern
trait Subject {
private var observers : List[(Subject) => Any] = Nil
def addObserver( cmd:(Subject) => Any ) = observers = cmd :: observers
def notifyObservers() = observers.foreach( _(this) )
}
Comments (0)
You don't have permission to comment on this page.