Álvaro Sánchez-Mariscal
About me
 Passionate software developer.
 Founder & CEO of Salenda and Escuela
  de Groovy.
 Groovy/Grails lover since 2007.
Typical Grails architecture
   Grails is an MVC, where:
     Model is implemented using POGO’s for
      GORM (Hibernate).
     Views are rendered on the server side using
      GSP’s and taglibs.
     Controllers are Groovy classes with methods
      as actions.
So what the hell is
a SPI application?
Single-page applications and Grails
A SPI web app is…
 A web application where you can navigate
  without any page refresh.
 REST is used to communicate with the
  server.
 The MVC is in the browser, written in
  Javascript, where:
     The model are Javascript classes.
     The views are written in HTML.
     The controller, services, etc. are also written in
      Javascript.
Did you say
Javascript?!?
                  WTF!




                WTF!
    Really?!?
Some people like Javascript
And why the hell
 should I care
  about SPI?
Because it has some advantages
   It’s faster, because:
     Modern browsers have faster Javascript
      engines.
     Only the data is sent, not the full markup.
   It has a better user experience,
    because:
     Data refreshes instantly.
   It may be easier for the developer:
     If you choose the right framework, you don’t
     have to deal with events or callbacks.
But, it also has some cons
 What happens if there is no Javascript?
  Are you going to gracefully degrade?
 How do we deal with server
  communication failures?
 Can I still use the application without an
  Internet connection?
 Am I going to replicate the MVC in the
  client? Again? In Javascript?
Ok. And how do I
implement it using
      Grails?
Less server logic
 Your Grails application gets simplified.
 Just use GORM (or any other backend)
  with a REST API.
     Implementing a REST API with Grails is
      really easy.
   Just focus on:
     Transactions.
     Data retrieving and storing.
     Security / authentication.
     Scalability
And do I really need
a Grails application
     for that?
Not really
 You can use Vert.x.
 Or if you want to be really cool, use
  Node.js.
 Even if you are really bored, you can
  just do it in Java…
News from this morning
   In Grails 3.0 you will have application
    profiles:
     Servlet “classic” profile.
     Lightweight profile.
     REST profile.
Ok with the server
 side. What can I
do with the client?
There’s lot of frameworks
Comprehensive comparision
   Todo MVC, by Addy Osmani
      and Sindre Sorhus.




http://addyosmani.github.com/todomvc/
Similar features
    Models.




                             }

     Domain classes.
   Views and templates.
     GSP’s and templates.
   {{ }}
     ${}
 Controllers.
 Routing.
     URL Mappings.
Gotchas
   Are views on the client really the best
    option? What about….?
     i18n?
     Security?
     Caching?
How do we handle dependency
 management in our Javascript code?
…
Show me some
 code please!
That’s all!
 Thanks!
Álvaro Sánchez-Mariscal
   @alvaro_sanchez

More Related Content

PDF
Developing SPI applications using Grails and AngularJS
PPT
GROOVY ON GRAILS
PPTX
Web Based Development Introduction
PPTX
Latest Javascript MVC & Front End Frameworks 2017
PPTX
Introduction to mean stack
PPT
GROOVY ON GRAILS
PPT
Top java script frameworks ppt
PPTX
Developing SPI applications using Grails and AngularJS
GROOVY ON GRAILS
Web Based Development Introduction
Latest Javascript MVC & Front End Frameworks 2017
Introduction to mean stack
GROOVY ON GRAILS
Top java script frameworks ppt

What's hot (20)

PPTX
Microsoft Azure Cloud Services
PDF
The MEAN Stack
PPTX
MEAN Stack
PPTX
Angular js introduction
PDF
Pre-render Blazor WebAssembly on static web hosting at publishing time
PDF
Blazor introduction
PDF
JS Framework Comparison - An infographic
PDF
Vue3: nuove funzionalità, differenze e come migrare
PPTX
Single Page Application (SPA) using AngularJS
PDF
Angular js - 10 reasons to choose angularjs
PDF
NodeSummit - MEAN Stack
PPT
A First Look at Windows Presentation Foundation Everywhere (WPF/E): a Cross …
PDF
Node PDX: Intro to Sails.js
PDF
Mean Stack - An Overview
PDF
The Future Of Web Frameworks
PDF
SxSW 2015
PDF
Introduce Angular2 & render & firebase flow
PPTX
A Minimalist’s Attempt at Building a Distributed Application
Microsoft Azure Cloud Services
The MEAN Stack
MEAN Stack
Angular js introduction
Pre-render Blazor WebAssembly on static web hosting at publishing time
Blazor introduction
JS Framework Comparison - An infographic
Vue3: nuove funzionalità, differenze e come migrare
Single Page Application (SPA) using AngularJS
Angular js - 10 reasons to choose angularjs
NodeSummit - MEAN Stack
A First Look at Windows Presentation Foundation Everywhere (WPF/E): a Cross …
Node PDX: Intro to Sails.js
Mean Stack - An Overview
The Future Of Web Frameworks
SxSW 2015
Introduce Angular2 & render & firebase flow
A Minimalist’s Attempt at Building a Distributed Application
Ad

Similar to Single-page applications and Grails (20)

PDF
Scaling Your Team With GraphQL: Why Relationships Matter
PDF
Maintainable Javascript carsonified
PPTX
Unit 4 Java script.pptx
PPTX
Glimpse of Loops Vs Set
PPTX
Academy PRO: HTML5 API graphics
PPTX
Front End Development | Introduction
PPTX
Web Development Today
PDF
Angularjs interview questions and answers
PPTX
Lightweight webdev
PDF
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
PPTX
txWelcome to Javascript Welcome to Javascript.pp
PDF
JSFest 2019: Technology agnostic microservices at SPA frontend
PPTX
Asp.netmvc handson
ODP
The Importance Things of Full Stack Development
PPTX
Which is better asp.net mvc vs asp.net
DOCX
Codeigniter
PPTX
Magic with groovy & grails
PDF
Avigma Tech LLC- Why the MVC pattern so popular?
PPTX
Best of Microsoft Dev Camp 2015
PDF
Designing and Implementing a Multiuser Apps Platform
Scaling Your Team With GraphQL: Why Relationships Matter
Maintainable Javascript carsonified
Unit 4 Java script.pptx
Glimpse of Loops Vs Set
Academy PRO: HTML5 API graphics
Front End Development | Introduction
Web Development Today
Angularjs interview questions and answers
Lightweight webdev
Practical Thin Server Architecture With Dojo Sapo Codebits 2008
txWelcome to Javascript Welcome to Javascript.pp
JSFest 2019: Technology agnostic microservices at SPA frontend
Asp.netmvc handson
The Importance Things of Full Stack Development
Which is better asp.net mvc vs asp.net
Codeigniter
Magic with groovy & grails
Avigma Tech LLC- Why the MVC pattern so popular?
Best of Microsoft Dev Camp 2015
Designing and Implementing a Multiuser Apps Platform
Ad

More from Alvaro Sanchez-Mariscal (20)

PDF
Serverless functions with Micronaut
PDF
Asynchronous and event-driven Grails applications
PDF
6 things you need to know about GORM 6
PDF
Reactive microservices with Micronaut - GR8Conf EU 2018
PDF
Reactive microservices with Micronaut - Greach 2018
PDF
Practical Spring Cloud
PDF
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
PDF
Mastering Grails 3 Plugins - G3 Summit 2016
PDF
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
PDF
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
PDF
Mastering Grails 3 Plugins - GR8Conf US 2016
PDF
Mastering Grails 3 Plugins - GR8Conf EU 2016
PDF
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
PDF
Mastering Grails 3 Plugins - Greach 2016
PDF
Creating applications with Grails, Angular JS and Spring Security
PDF
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
PDF
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
PDF
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
PDF
Stateless authentication for microservices - GR8Conf 2015
PDF
Ratpack 101 - GR8Conf 2015
Serverless functions with Micronaut
Asynchronous and event-driven Grails applications
6 things you need to know about GORM 6
Reactive microservices with Micronaut - GR8Conf EU 2018
Reactive microservices with Micronaut - Greach 2018
Practical Spring Cloud
Creating applications with Grails, Angular JS and Spring Security - G3 Summit...
Mastering Grails 3 Plugins - G3 Summit 2016
Desarrollo de aplicaciones con Grails 3, Angular JS y Spring Security
Creating applications with Grails, Angular JS and Spring Security - GR8Conf U...
Mastering Grails 3 Plugins - GR8Conf US 2016
Mastering Grails 3 Plugins - GR8Conf EU 2016
Creating applications with Grails, Angular JS and Spring Security - GR8Conf E...
Mastering Grails 3 Plugins - Greach 2016
Creating applications with Grails, Angular JS and Spring Security
Efficient HTTP applications on the JVM with Ratpack - Voxxed Days Berlin 2016
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Stateless authentication with OAuth 2 and JWT - JavaZone 2015
Stateless authentication for microservices - GR8Conf 2015
Ratpack 101 - GR8Conf 2015

Recently uploaded (20)

PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPT
Geologic Time for studying geology for geologist
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Unlock new opportunities with location data.pdf
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
The various Industrial Revolutions .pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
August Patch Tuesday
PDF
Five Habits of High-Impact Board Members
DP Operators-handbook-extract for the Mautical Institute
Benefits of Physical activity for teenagers.pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Getting Started with Data Integration: FME Form 101
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Geologic Time for studying geology for geologist
O2C Customer Invoices to Receipt V15A.pptx
Chapter 5: Probability Theory and Statistics
Unlock new opportunities with location data.pdf
A novel scalable deep ensemble learning framework for big data classification...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
sustainability-14-14877-v2.pddhzftheheeeee
Taming the Chaos: How to Turn Unstructured Data into Decisions
Univ-Connecticut-ChatGPT-Presentaion.pdf
Assigned Numbers - 2025 - Bluetooth® Document
The various Industrial Revolutions .pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
August Patch Tuesday
Five Habits of High-Impact Board Members

Single-page applications and Grails

  • 2. About me  Passionate software developer.  Founder & CEO of Salenda and Escuela de Groovy.  Groovy/Grails lover since 2007.
  • 3. Typical Grails architecture  Grails is an MVC, where:  Model is implemented using POGO’s for GORM (Hibernate).  Views are rendered on the server side using GSP’s and taglibs.  Controllers are Groovy classes with methods as actions.
  • 4. So what the hell is a SPI application?
  • 6. A SPI web app is…  A web application where you can navigate without any page refresh.  REST is used to communicate with the server.  The MVC is in the browser, written in Javascript, where:  The model are Javascript classes.  The views are written in HTML.  The controller, services, etc. are also written in Javascript.
  • 7. Did you say Javascript?!? WTF! WTF! Really?!?
  • 8. Some people like Javascript
  • 9. And why the hell should I care about SPI?
  • 10. Because it has some advantages  It’s faster, because:  Modern browsers have faster Javascript engines.  Only the data is sent, not the full markup.  It has a better user experience, because:  Data refreshes instantly.  It may be easier for the developer:  If you choose the right framework, you don’t have to deal with events or callbacks.
  • 11. But, it also has some cons  What happens if there is no Javascript? Are you going to gracefully degrade?  How do we deal with server communication failures?  Can I still use the application without an Internet connection?  Am I going to replicate the MVC in the client? Again? In Javascript?
  • 12. Ok. And how do I implement it using Grails?
  • 13. Less server logic  Your Grails application gets simplified.  Just use GORM (or any other backend) with a REST API.  Implementing a REST API with Grails is really easy.  Just focus on:  Transactions.  Data retrieving and storing.  Security / authentication.  Scalability
  • 14. And do I really need a Grails application for that?
  • 15. Not really  You can use Vert.x.  Or if you want to be really cool, use Node.js.  Even if you are really bored, you can just do it in Java…
  • 16. News from this morning  In Grails 3.0 you will have application profiles:  Servlet “classic” profile.  Lightweight profile.  REST profile.
  • 17. Ok with the server side. What can I do with the client?
  • 18. There’s lot of frameworks
  • 19. Comprehensive comparision  Todo MVC, by Addy Osmani and Sindre Sorhus. http://addyosmani.github.com/todomvc/
  • 20. Similar features Models. }   Domain classes.  Views and templates.  GSP’s and templates.  {{ }}  ${}  Controllers.  Routing.  URL Mappings.
  • 21. Gotchas  Are views on the client really the best option? What about….?  i18n?  Security?  Caching? How do we handle dependency management in our Javascript code? …
  • 22. Show me some code please!
  • 23. That’s all! Thanks! Álvaro Sánchez-Mariscal @alvaro_sanchez