Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Isomorphic javascript in real

Isomorphic javascript in real

architectural overview of a working isomorphic solution plus some funny images of course

Riccardo Maggi

May 13, 2015
Tweet

Other Decks in Programming

Transcript

  1. Agenda   An  implementa6on  that  worked   Why  is  it

     useful   What  is  “isomorhpism”  
  2. “In  mathema6cs,  an  isomorphism   (from  the  Ancient  Greek:  ἴσος

     isos   "equal",  and  μορφή  morphe   "shape")  is  a  homomorphism  that   admits  an  inverse.”     Isomorphic  defini6on    
  3. “In  mathema6cs,  an  isomorphism   (from  the  Ancient  Greek:  ἴσος

     isos   "equal",  and  μορφή  morphe   "shape")  is  a  homomorphism  that   admits  an  inverse.”     Isomorphic  what?    
  4. An  example   CAR  proper6es!   I  need  an  engine

        I  need  a  steering  wheel   I  want  to  go  to  holiday!  
  5. river   context   An  isomorphic  car!   road  

    context   Proper6es  always  sa6sfied!  
  6. I  want  to  build  some  isomorphic  stuff   New  front

     end  architecture   Single  Page  Applica6on  
  7. A   B   C   D E   SPA

     managing  different  states  flow  
  8. A   B   C   D E   What

     if  need  direct  access  to  every  state?  
  9. ✔   ✔   What  if  I  want  to  share

     business  logic?   Shared  valida<on  logic   Shared  sor<ng  algorithm  
  10. I  need  an  isomorphic  app   Template  rendering   Business

     logic   Template  rendering   Business  logic  
  11. BL   10000  b  view   Ask  for  a  page

      Ask  for  BL  data   HTML   builder   data   engine   client  JS  app   Make  an     interac<on   ✔   Ask  for  BL  data  
  12. Where  the  data  comes  from?   BE  service   BE

     service   BE  service   BE  service   Javascript     Mashup   orchestrator   {JSON}   {JSON}   {JSON}   {JSON}   {JSON}   Data  engine  
  13. ExpressJS  app   How  do  we  build  HTML  server  side?

      HTTP  RS     {JSON}   Javascript     Mashup   orchestrator   HTTP  RQ   HTTP  RQ   HTTP  RS   <HTML/>   HTML  builder  
  14. MV*  JS  app   How  do  we  manage  interac6ons?  

    AJAX  RS   {JSON}   Javascript     Mashup   orchestrator   Catch  interac<on   AJAX  RQ   View  render   client  JS  app  
  15. Javascript     Mashup   orchestrator   How  it  works

     all  together   Express  app   MV*   Ask  for  a  page   Ask  for  BL  data   {JSON}   {JSON}   Ask  for  BL  data   Make  an     interac<on  
  16. Leb  over  from    today   New  way  to  solve

     old  problems   No  need  of  math  PhD   You  can  build  your  own  
  17. grunQile.json   bower.json   A  Generic  Module   External  library

      (like  backbone)   Venere  library   Venere  library   A  Venere  module