rt mvc
play

RT-MVC Real Time Model/View/Controller Applications Daniel Erickson - PowerPoint PPT Presentation

11/7/12 Real Time and MVC with GeddyJS RT-MVC Real Time Model/View/Controller Applications Daniel Erickson qConSF / file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?printpdf#/1 1/30 11/7/12 Real Time and MVC


  1. 11/7/12 Real Time and MVC with GeddyJS RT-MVC Real Time Model/View/Controller Applications Daniel Erickson qConSF / file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 1/30

  2. 11/7/12 Real Time and MVC with GeddyJS WHAT'S GOING TO WIN REAL TIME OR MVC? file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 2/30

  3. 11/7/12 Real Time and MVC with GeddyJS REAL TIME? file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 3/30

  4. 11/7/12 Real Time and MVC with GeddyJS YEAH! 'CUZ SOME PEOPLE SAY: MVC doesn't scale well MVC is dead file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 4/30

  5. 11/7/12 Real Time and MVC with GeddyJS BUT MVC IS HERE TO STAY Gives teams structure to get things done Allows new people to jump into your project Easy to get started with file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 5/30

  6. 11/7/12 Real Time and MVC with GeddyJS WHAT'S GOING TO WIN REAL TIME OR MVC? file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 6/30

  7. 11/7/12 Real Time and MVC with GeddyJS MVC? file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 7/30

  8. 11/7/12 Real Time and MVC with GeddyJS TOTALLY! 'CUZ PEOPLE THINK: Real Time is hard Maintain a new stack Event Machine and Tornado suck Front end code is messy file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 8/30

  9. 11/7/12 Real Time and MVC with GeddyJS BUT REAL TIME IS ALSO HERE TO STAY Use WebSockets to get updates on the front end Instant feedback for your users Works really well on mobile file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 9/30

  10. 11/7/12 Real Time and MVC with GeddyJS WHAT'S GOING TO WIN REAL TIME OR MVC? file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 10/30

  11. 11/7/12 Real Time and MVC with GeddyJS BOTH! file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 11/30

  12. 11/7/12 Real Time and MVC with GeddyJS REAL TIME AND MVC ACTUALLY MIX PRETTY WELL file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 12/30

  13. 11/7/12 Real Time and MVC with GeddyJS YOU CAN: Define your model once and use it all over the place use your templates on both sides of HTTP Mirror events from the backend to the frontend instance created instace updated instance removed file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 13/30

  14. 11/7/12 Real Time and MVC with GeddyJS HOW WE SOLVED THE REAL TIME PROBLEM WITH GEDDY file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 14/30

  15. 11/7/12 Real Time and MVC with GeddyJS WAIT, WHAT'S GEDDY? file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 15/30

  16. 11/7/12 Real Time and MVC with GeddyJS THE ORIGINAL MVC FRAMEWORK FOR NODE.JS Very familiar if you know Rails Awesome noSQL and SQL ORM Many different templating languages file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 16/30

  17. 11/7/12 Real Time and MVC with GeddyJS AND NOW IT SUPPORTS REAL TIME RIGHT OUT OF THE BOX file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 17/30

  18. 11/7/12 Real Time and MVC with GeddyJS SO LETS MAKE AN MVC APP THAT SUPPORTS REAL TIME file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 18/30

  19. 11/7/12 Real Time and MVC with GeddyJS GENERATE AN APP $ npm install -g geddy $ geddy app -rt demo $ cd demo $ geddy scaffold -rt thing title description $ geddy file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 19/30

  20. 11/7/12 Real Time and MVC with GeddyJS TEST IT OUT http://localhost:4000/things Open up http://localhost:4000/things/add and file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 20/30

  21. 11/7/12 Real Time and MVC with GeddyJS FOR THOSE OF YOU FOLLOWING ALONG AT HOME 1. add a thing 2. watch it show up in the other window 3. update the thing 4. watch it change in the other window 5. remove the item 6. watch it get removed from the other window. file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 21/30

  22. 11/7/12 Real Time and MVC with GeddyJS WHAT JUST HAPPENED? geddy app -rt demo Generated a demo app with realtime enabled file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 22/30

  23. 11/7/12 Real Time and MVC with GeddyJS WHAT JUST HAPPENED? geddy scaffold -rt thing ... Generated a thing resource thing model made that model available on the front end things controller routes views that subscribe to the realtime events file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 23/30

  24. 11/7/12 Real Time and MVC with GeddyJS HOW DOES IT WORK? ON THE SERVER SIDE: geddy sees the realtime flag in your config file copies your models over to a public js file sets up listeners for each model's lifecycle events proxies those lifecycle events to socket.io file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 24/30

  25. 11/7/12 Real Time and MVC with GeddyJS HOW DOES IT WORK? ON THE CLIENT SIDE: registers listeners for all model related events proxies them to the appropriate models scaffolds some code that hooks into real time events file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 25/30

  26. 11/7/12 Real Time and MVC with GeddyJS THATS PRETTY COOL, BUT IS IT EASY TO CHANGE? modify your model once and you get it everywhere emit custom events on your models all generated code can be modified file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 26/30

  27. 11/7/12 Real Time and MVC with GeddyJS WHAT'S NEXT ON THE ROADMAP? Create an AJAX adapter for the front-end ORM Real time queries Per instance real time events A better way to share templates file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 27/30

  28. 11/7/12 Real Time and MVC with GeddyJS WANT TO HELP OUT? CHECK OUT GEDDY AT http://geddyjs.org Join the mailinglist open bugs on github send us pull requests file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 28/30

  29. 11/7/12 Real Time and MVC with GeddyJS ANY QUESTIONS? file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 29/30

  30. 11/7/12 Real Time and MVC with GeddyJS file://localhost/Users/derickson/dev/presentations/2012/qconsf/index.html?print‑pdf#/1 30/30

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend