Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Deprecating the Observer Pattern

1.066 visualizaciones

Publicado el

This presentation introduces the paper "Deprecating the Observer Pattern with Scala.React". It highlights the major contributions of this paper, while avoiding Scala. Some ideas to make the approach more generic are proposed. An evaluation towards embedded systems shows the potential and risks when applying reactive programming in this area.

Publicado en: Tecnología
  • Sé el primero en comentar

Deprecating the Observer Pattern

  1. 1. PL@NES - Reading Club Paper: Deprecating the Observer Pattern with Scala.React by Ingo Maier & Martin Odersky Christophe.VanGinneken@cs.kuleuven.be
  2. 2. R THE FOLLOWING PRESENTATION DOES NOT INCLUDE MATERIAL ABOUT SCALA NOR SCALA.REACT. IT WILL HIGHLIGHT THE GREAT PARTS OF THE ORIGINAL PAPER IN A GENERIC WAY. RECOMMENDED MIGHT CONTAIN MILD HUMOR. MIGHT PROVOKE INTELLECTUAL DISCUSSIONS AND CAUSE FRESH IDEAS TO EMERGE. christophe.vg distrinet.cs.kuleuven.be
  3. 3. • Observer Pattern • Reactive Semantics • Scala.React • Reactive Performance Contributions ok, maybe a little ;-) 3 Goals • summary of RP • applicability to NES
  4. 4. Observer Pattern 4
  5. 5. Observer Pattern var path: Path = null! ! val moveObserver = { (event: MouseEvent) =>! path.lineTo(event.position)! draw(path)! }! ! control.addMouseDownObserver { event =>! path = new Path(event.position)! control.addMouseMoveObserver(moveObserver)! }! ! control.addMouseUpObserver { event =>! control.removeMouseMoveObserver(moveObserver)! path.close()! draw(path)! }! 6 side-effects encapsulation composability resource
 managementseparation of concerns data consistency uniformity abstraction semantic distance
  6. 6. • Event Streams • Events and Signals • Composition/Transformation • Reactors • Data Flow Language Reactive Semantics dependency graph merge, map, filter,… Resource Mgmt Inversion of Control pause, await, par, join, loop,… events signal observable observers (with simple interfaces) 8 scripting of dynamic & structural dependency graph modifications lifting behavior
  7. 7. Reactive Semantics 9 + API for dynamic binding modifications
  8. 8. Reactive Performance 11 observer Scala.React others chain fan …source observer source observers …
  9. 9. ARM 32-bit Cortex™-M3 CPU Core 72Mhz operating frequency Does it Scale? 12 on embedded devices Intel 2,4 GHz Intel Core 2 Duo 2530Mhz operating frequency Throughput (updates/second) 0 325.000 650.000 975.000 1.300.000 observer.c reactive-c 802.978 1.243.955 611.356 723.345 chain fan Throughput (updates/second) (Spark Core) 0 2750 5500 8250 11000 observer.c reactive-c 5.501,5 10.294 5.189 9.871 chain fan -50% -30% : 110
  10. 10. “Time moves in one direction, memory in another.” William Gibson
  11. 11. Shameless Plug Reactive-C Rose https://github.com/christophevg/reactive-c https://github.com/christophevg/rose 14
  12. 12. • Automate Dependency Graph Management • Avoid Data Inconsistencies • Offer a Functional API • Allow for Imperative Encoding of Algorithms Deprecating the Observer Pattern? Observer Pattern on Steroids ! 15
  13. 13. Reactions ?
  14. 14. http://www.slideshare.net/christophevg/deprecating-the-observer-pattern Christophe.VanGinneken@cs.kuleuven.be

×