SlideShare a Scribd company logo
1 of 72
Groovy: Efficiency Oriented Programming
Lecture 9
Master Proteomics & Bioinformatics - University of Geneva
Alexandre Masselot - summer 2011
Contents
Contents

‣ Eclipse tips: tasks
Contents

‣ Eclipse tips: tasks
‣ Productive developer tips: technical debt
Contents

‣ Eclipse tips: tasks
‣ Productive developer tips: technical debt
‣ Web applications
Contents

‣ Eclipse tips: tasks
‣ Productive developer tips: technical debt
‣ Web applications
‣ Grails
Contents

‣ Eclipse tips: tasks
‣ Productive developer tips: technical debt
‣ Web applications
‣ Grails
‣ Twitter application: step 1
Eclipse tips
Eclipse tips

‣ Annotate code with tasks
Eclipse tips

‣ Annotate code with tasks
‣ TODO / FIXME
Eclipse tips

‣ Annotate code with tasks
‣ TODO / FIXME
‣ Add comments into your code
 
 void mutate(){
      //TODO check that mutation **does** modify position
 
 
 board.piecesPositions[
              randomGenerator.nextInt(board.maxPieces)] =
 
 
 
 [
           randomGenerator.nextInt(board.size),
           randomGenerator.nextInt(board.size)
         ]
 
 }
Eclipse tips   (cont’d)
Eclipse tips                       (cont’d)

‣ Lines is prefixed with an icon
Eclipse tips                       (cont’d)

‣ Lines is prefixed with an icon
‣ The task view
Technical debt
Technical debt

‣ Increasing the debt:
  - poor code
  - repeat in code/process (DRY)
  - postponing refactoring
  - skipping tests
Technical debt

‣ Increasing the debt:
  - poor code
  - repeat in code/process (DRY)
  - postponing refactoring
  - skipping tests

‣ Interest are expensive
Technical debt

‣ Increasing the debt:
  - poor code
  - repeat in code/process (DRY)
  - postponing refactoring
  - skipping tests

‣ Interest are expensive
‣ A common solution: use prototyping
What do you know about www?
A simple (static) web query
protocol
protocol   server host
protocol   server host   resource path
1 find the server (DNS)
1 find the server (DNS)
2 pass the local resource requested
1 find the server (DNS)
2 pass the local resource requested
3 server loads the resource to be served
1 find the server (DNS)
2 pass the local resource requested
3 server loads the resource to be served
4 resource sent back to the browser (client)
1 find the server (DNS)
2 pass the local resource requested
3 server loads the resource to be served
4 resource sent back to the browser (client)
5 browser interprets the response
1 find the server (DNS)
2 pass the local resource requested
3 server loads the resource to be served
4 resource sent back to the browser (client)
5 browser interprets the response
6 browser loads additional resources (+ requests)
1 find the server (DNS)
2 pass the local resource requested
3 server loads the resource to be served
4 resource sent back to the browser (client)
5 browser interprets the response
6 browser loads additional resources (+ requests)
7 browser displays results
Static is not alway enough
   dynamic url queries
An action is performed on the server side
          parameter are passed
action path
action path   parameter(s)
action path         parameter(s)


Instead of a static resource, the results is computed
Master your browser!
Today: firefox (idem for chrome, safari, ~IE)
View page source
(best inspiration is by copying others)
Install firebug & web developer add-ons
display loaded resources
firebug > network
static page
dynamic resource + interactions
More operations can be undertaken within page
But cycle query->server->rendering
             is always respected
More operations can be undertaken within page
But cycle query->server->rendering
             is always respected
Why using/building web based applications?
A script does not suit everyone (unfortunately)
Classic deploy: window based application
A web browser: a powerful GUI
A web transaction
A web transaction

‣ Url request
  - http://host:8080/entry/show?ac=P12345&format=fasta
A web transaction

‣ Url request
  - http://host:8080/entry/show?ac=P12345&format=fasta

‣ Action
  - build the model
A web transaction

‣ Url request
  - http://host:8080/entry/show?ac=P12345&format=fasta

‣ Action
  - build the model

‣ View generation
  - html contents creation
A web transaction

‣ Url request
  - http://host:8080/entry/show?ac=P12345&format=fasta

‣ Action
  - build the model

‣ View generation
  - html contents creation

‣ Rendering
A web transaction

‣ Url request                             [browser]
  - http://host:8080/entry/show?ac=P12345&format=fasta

‣ Action                                    [server]
  - build the model

‣ View generation                           [server]
  - html contents creation

‣ Rendering                               [browser]
Groovy + web = Grails
Grails with STS eclipse
Grails with STS eclipse

‣ Help > dashboard > extensions > Grails
Grails with STS eclipse

‣ Help > dashboard > extensions > Grails
‣ Download Grails
  - http://grails.org/Download
Grails with STS eclipse

‣ Help > dashboard > extensions > Grails
‣ Download Grails
  - http://grails.org/Download

‣ Uncompress in local directory
  - e.g. ~/local/grails-1.3.7
Grails with STS eclipse

‣ Help > dashboard > extensions > Grails
‣ Download Grails
  - http://grails.org/Download

‣ Uncompress in local directory
  - e.g. ~/local/grails-1.3.7

‣ Configure Grails in STS preferences
  - possible to host multiple versions
Grails with STS eclipse

‣ Help > dashboard > extensions > Grails
‣ Download Grails
  - http://grails.org/Download

‣ Uncompress in local directory
  - e.g. ~/local/grails-1.3.7

‣ Configure Grails in STS preferences
  - possible to host multiple versions

‣ Reference
  - http://grails.org/doc/latest/
Grails with STS eclipse                          (cont’d)

‣ Configure shortcut for grails command prompt
Grails with STS eclipse                           (cont’d)

‣ Configure shortcut for grails command prompt
‣ Preference > keys
                     > open grails command prompt
  - <ctrl> <alt> G
  - (maybe need to deactivate another shortcut)
Grails with STS eclipse                           (cont’d)

‣ Configure shortcut for grails command prompt
‣ Preference > keys
                     > open grails command prompt
  - <ctrl> <alt> G
  - (maybe need to deactivate another shortcut)

‣ Calling grails command on selected project
STS: creating a new Grails application
STS: creating a new Grails application

‣ File > new
 > Grails project

More Related Content

What's hot

Cool JVM Tools to Help You Test
Cool JVM Tools to Help You TestCool JVM Tools to Help You Test
Cool JVM Tools to Help You TestSchalk Cronjé
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golangTing-Li Chou
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin WritingSchalk Cronjé
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN GolangBo-Yi Wu
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in phpBo-Yi Wu
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidenceJohn Congdon
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding styleBo-Yi Wu
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to GriffonJames Williams
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedFabian Jakobs
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Schalk Cronjé
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradleLiviu Tudor
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90minsLarry Cai
 
Trust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker ContainersTrust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker ContainersNan Liu
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.Javier López
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP applicationJavier López
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsTobias Oetiker
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Rajmahendra Hegde
 

What's hot (20)

Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Cool JVM Tools to Help You Test
Cool JVM Tools to Help You TestCool JVM Tools to Help You Test
Cool JVM Tools to Help You Test
 
Build microservice with gRPC in golang
Build microservice with gRPC in golangBuild microservice with gRPC in golang
Build microservice with gRPC in golang
 
Rest, sockets em golang
Rest, sockets em golangRest, sockets em golang
Rest, sockets em golang
 
Basic Gradle Plugin Writing
Basic Gradle Plugin WritingBasic Gradle Plugin Writing
Basic Gradle Plugin Writing
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
C++ for the Web
C++ for the WebC++ for the Web
C++ for the Web
 
Gearman work queue in php
Gearman work queue in phpGearman work queue in php
Gearman work queue in php
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
PHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding stylePHP & JavaScript & CSS Coding style
PHP & JavaScript & CSS Coding style
 
Introduction to Griffon
Introduction to GriffonIntroduction to Griffon
Introduction to Griffon
 
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of SzegedLecture 8 - Qooxdoo - Rap Course At The University Of Szeged
Lecture 8 - Qooxdoo - Rap Course At The University Of Szeged
 
Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016Idiomatic Gradle Plugin Writing - GradleSummit 2016
Idiomatic Gradle Plugin Writing - GradleSummit 2016
 
Managing dependencies with gradle
Managing dependencies with gradleManaging dependencies with gradle
Managing dependencies with gradle
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Trust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker ContainersTrust, but verify | Testing with Docker Containers
Trust, but verify | Testing with Docker Containers
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012Gradle build tool that rocks with DSL JavaOne India 4th May 2012
Gradle build tool that rocks with DSL JavaOne India 4th May 2012
 

Similar to groovy & grails - lecture 9

Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developermpaproductions
 
Fast web development using groovy on grails
Fast web development using groovy on grailsFast web development using groovy on grails
Fast web development using groovy on grailsAnshuman Biswal
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.skJuraj Hantak
 
Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsBruno Padilha
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Annie Huang
 
TIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersTIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersThe Incredible Automation Day
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 
Kubernetes best practices
Kubernetes best practicesKubernetes best practices
Kubernetes best practicesBill Liu
 
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018Amazon Web Services
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
Running MongoDB Enterprise on Kubernetes
Running MongoDB Enterprise on KubernetesRunning MongoDB Enterprise on Kubernetes
Running MongoDB Enterprise on KubernetesAriel Jatib
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukMarcinStachniuk
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaKévin Margueritte
 

Similar to groovy & grails - lecture 9 (20)

Basic Rails Training
Basic Rails TrainingBasic Rails Training
Basic Rails Training
 
Life of a Chromium Developer
Life of a Chromium DeveloperLife of a Chromium Developer
Life of a Chromium Developer
 
CI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOWCI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOW
 
Fast web development using groovy on grails
Fast web development using groovy on grailsFast web development using groovy on grails
Fast web development using groovy on grails
 
Gitlab ci, cncf.sk
Gitlab ci, cncf.skGitlab ci, cncf.sk
Gitlab ci, cncf.sk
 
Paris container day june17
Paris container day   june17Paris container day   june17
Paris container day june17
 
Continuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e JenkinsContinuous Delivery com Docker, OpenShift e Jenkins
Continuous Delivery com Docker, OpenShift e Jenkins
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD Webinar - Unbox GitLab CI/CD
Webinar - Unbox GitLab CI/CD
 
TIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containersTIAD 2016 : Migrating 100% of your production services to containers
TIAD 2016 : Migrating 100% of your production services to containers
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
Gradle como alternativa a maven
Gradle como alternativa a mavenGradle como alternativa a maven
Gradle como alternativa a maven
 
Kubernetes best practices
Kubernetes best practicesKubernetes best practices
Kubernetes best practices
 
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
Container Power Hour with Jess, Clare, and Abby (CON362) - AWS re:Invent 2018
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Development Workflows on AWS
Development Workflows on AWSDevelopment Workflows on AWS
Development Workflows on AWS
 
Running MongoDB Enterprise on Kubernetes
Running MongoDB Enterprise on KubernetesRunning MongoDB Enterprise on Kubernetes
Running MongoDB Enterprise on Kubernetes
 
Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin Stachniuk
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 

More from Alexandre Masselot

Offshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do itOffshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do itAlexandre Masselot
 
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data StackDev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data StackAlexandre Masselot
 
Swiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data StackSwiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data StackAlexandre Masselot
 

More from Alexandre Masselot (10)

Offshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do itOffshoring software development in Switzerland: You can do it
Offshoring software development in Switzerland: You can do it
 
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data StackDev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
Dev Wednesday - Swiss Transport in Real Time: Tribulations in the Big Data Stack
 
Swiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data StackSwiss Transport in Real Time: Tribulations in the Big Data Stack
Swiss Transport in Real Time: Tribulations in the Big Data Stack
 
groovy & grails - lecture 8
groovy & grails - lecture 8groovy & grails - lecture 8
groovy & grails - lecture 8
 
groovy & grails - lecture 2
groovy & grails - lecture 2groovy & grails - lecture 2
groovy & grails - lecture 2
 
groovy & grails - lecture 1
groovy & grails - lecture 1groovy & grails - lecture 1
groovy & grails - lecture 1
 
groovy & grails - lecture 11
groovy & grails - lecture 11groovy & grails - lecture 11
groovy & grails - lecture 11
 
groovy & grails - lecture 12
groovy & grails - lecture 12groovy & grails - lecture 12
groovy & grails - lecture 12
 
groovy & grails - lecture 7
groovy & grails - lecture 7groovy & grails - lecture 7
groovy & grails - lecture 7
 
groovy & grails - lecture 3
groovy & grails - lecture 3groovy & grails - lecture 3
groovy & grails - lecture 3
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

groovy & grails - lecture 9

  • 1. Groovy: Efficiency Oriented Programming Lecture 9 Master Proteomics & Bioinformatics - University of Geneva Alexandre Masselot - summer 2011
  • 4. Contents ‣ Eclipse tips: tasks ‣ Productive developer tips: technical debt
  • 5. Contents ‣ Eclipse tips: tasks ‣ Productive developer tips: technical debt ‣ Web applications
  • 6. Contents ‣ Eclipse tips: tasks ‣ Productive developer tips: technical debt ‣ Web applications ‣ Grails
  • 7. Contents ‣ Eclipse tips: tasks ‣ Productive developer tips: technical debt ‣ Web applications ‣ Grails ‣ Twitter application: step 1
  • 9. Eclipse tips ‣ Annotate code with tasks
  • 10. Eclipse tips ‣ Annotate code with tasks ‣ TODO / FIXME
  • 11. Eclipse tips ‣ Annotate code with tasks ‣ TODO / FIXME ‣ Add comments into your code void mutate(){ //TODO check that mutation **does** modify position board.piecesPositions[ randomGenerator.nextInt(board.maxPieces)] = [ randomGenerator.nextInt(board.size), randomGenerator.nextInt(board.size) ] }
  • 12. Eclipse tips (cont’d)
  • 13. Eclipse tips (cont’d) ‣ Lines is prefixed with an icon
  • 14. Eclipse tips (cont’d) ‣ Lines is prefixed with an icon ‣ The task view
  • 16. Technical debt ‣ Increasing the debt: - poor code - repeat in code/process (DRY) - postponing refactoring - skipping tests
  • 17. Technical debt ‣ Increasing the debt: - poor code - repeat in code/process (DRY) - postponing refactoring - skipping tests ‣ Interest are expensive
  • 18. Technical debt ‣ Increasing the debt: - poor code - repeat in code/process (DRY) - postponing refactoring - skipping tests ‣ Interest are expensive ‣ A common solution: use prototyping
  • 19. What do you know about www?
  • 20. A simple (static) web query
  • 21.
  • 23. protocol server host
  • 24. protocol server host resource path
  • 25.
  • 26. 1 find the server (DNS)
  • 27. 1 find the server (DNS) 2 pass the local resource requested
  • 28. 1 find the server (DNS) 2 pass the local resource requested 3 server loads the resource to be served
  • 29. 1 find the server (DNS) 2 pass the local resource requested 3 server loads the resource to be served 4 resource sent back to the browser (client)
  • 30. 1 find the server (DNS) 2 pass the local resource requested 3 server loads the resource to be served 4 resource sent back to the browser (client) 5 browser interprets the response
  • 31. 1 find the server (DNS) 2 pass the local resource requested 3 server loads the resource to be served 4 resource sent back to the browser (client) 5 browser interprets the response 6 browser loads additional resources (+ requests)
  • 32. 1 find the server (DNS) 2 pass the local resource requested 3 server loads the resource to be served 4 resource sent back to the browser (client) 5 browser interprets the response 6 browser loads additional resources (+ requests) 7 browser displays results
  • 33.
  • 34. Static is not alway enough dynamic url queries
  • 35. An action is performed on the server side parameter are passed
  • 36.
  • 38. action path parameter(s)
  • 39. action path parameter(s) Instead of a static resource, the results is computed
  • 40. Master your browser! Today: firefox (idem for chrome, safari, ~IE)
  • 41. View page source (best inspiration is by copying others)
  • 42.
  • 43. Install firebug & web developer add-ons
  • 46.
  • 47. dynamic resource + interactions
  • 48.
  • 49. More operations can be undertaken within page But cycle query->server->rendering is always respected
  • 50. More operations can be undertaken within page But cycle query->server->rendering is always respected
  • 51. Why using/building web based applications?
  • 52. A script does not suit everyone (unfortunately)
  • 53. Classic deploy: window based application
  • 54. A web browser: a powerful GUI
  • 56. A web transaction ‣ Url request - http://host:8080/entry/show?ac=P12345&format=fasta
  • 57. A web transaction ‣ Url request - http://host:8080/entry/show?ac=P12345&format=fasta ‣ Action - build the model
  • 58. A web transaction ‣ Url request - http://host:8080/entry/show?ac=P12345&format=fasta ‣ Action - build the model ‣ View generation - html contents creation
  • 59. A web transaction ‣ Url request - http://host:8080/entry/show?ac=P12345&format=fasta ‣ Action - build the model ‣ View generation - html contents creation ‣ Rendering
  • 60. A web transaction ‣ Url request [browser] - http://host:8080/entry/show?ac=P12345&format=fasta ‣ Action [server] - build the model ‣ View generation [server] - html contents creation ‣ Rendering [browser]
  • 61. Groovy + web = Grails
  • 62. Grails with STS eclipse
  • 63. Grails with STS eclipse ‣ Help > dashboard > extensions > Grails
  • 64. Grails with STS eclipse ‣ Help > dashboard > extensions > Grails ‣ Download Grails - http://grails.org/Download
  • 65. Grails with STS eclipse ‣ Help > dashboard > extensions > Grails ‣ Download Grails - http://grails.org/Download ‣ Uncompress in local directory - e.g. ~/local/grails-1.3.7
  • 66. Grails with STS eclipse ‣ Help > dashboard > extensions > Grails ‣ Download Grails - http://grails.org/Download ‣ Uncompress in local directory - e.g. ~/local/grails-1.3.7 ‣ Configure Grails in STS preferences - possible to host multiple versions
  • 67. Grails with STS eclipse ‣ Help > dashboard > extensions > Grails ‣ Download Grails - http://grails.org/Download ‣ Uncompress in local directory - e.g. ~/local/grails-1.3.7 ‣ Configure Grails in STS preferences - possible to host multiple versions ‣ Reference - http://grails.org/doc/latest/
  • 68. Grails with STS eclipse (cont’d) ‣ Configure shortcut for grails command prompt
  • 69. Grails with STS eclipse (cont’d) ‣ Configure shortcut for grails command prompt ‣ Preference > keys > open grails command prompt - <ctrl> <alt> G - (maybe need to deactivate another shortcut)
  • 70. Grails with STS eclipse (cont’d) ‣ Configure shortcut for grails command prompt ‣ Preference > keys > open grails command prompt - <ctrl> <alt> G - (maybe need to deactivate another shortcut) ‣ Calling grails command on selected project
  • 71. STS: creating a new Grails application
  • 72. STS: creating a new Grails application ‣ File > new > Grails project
  • 73. New Grails project structure
  • 74. New Grails project structure %PROJECT_HOME% + grails-app + conf ---> configuration artifacts + controllers ---> controller artifacts + domain ---> domain classes + i18n ---> message bundles for i18n + services ---> services + taglib ---> tag libraries + util ---> special utility classes + views ---> views + layouts ---> layouts + lib + scripts ---> scripts + src + groovy ---> other Groovy source files + test ---> generated test classes + web-app + WEB-INF ---> static documents
  • 75. New Grails project structure %PROJECT_HOME% + grails-app + conf ---> configuration artifacts + controllers ---> controller artifacts + domain ---> domain classes + i18n ---> message bundles for i18n + services ---> services + taglib ---> tag libraries + util ---> special utility classes + views ---> views + layouts ---> layouts + lib + scripts ---> scripts + src + groovy ---> other Groovy source files + test ---> generated test classes + web-app + WEB-INF ---> static documents
  • 76. Launching the application ‣ Launch the server, either: - Run As > Grails Command (run-app) - <ctrl> <alt> G run-app↵ - command line (in the project folder): run-app
  • 77. Launching the application ‣ Launch the server, either: - Run As > Grails Command (run-app) - <ctrl> <alt> G run-app↵ - command line (in the project folder): run-app ‣ Check console for messages
  • 78. Launching the application ‣ Launch the server, either: - Run As > Grails Command (run-app) - <ctrl> <alt> G run-app↵ - command line (in the project folder): run-app ‣ Check console for messages ‣ With your browser: - http://localhost:8080/eop.lec9.demo
  • 79.
  • 80. url ➙ controller (action) ➙ render 1) write code for controller/action 2) write rendering (html page)
  • 82. Create a controller ‣ Either: - - command line: create-controller foo.hello
  • 83.
  • 84.
  • 85. New files and directories: ./grails-app/controllers/foo/HelloController.groovy ./test/unit/foo/HelloControllerTests.groovy ./grails-app/views/hello/
  • 88. HelloController.groovy package foo class HelloController { def index = { } } ‣ hello = controller
  • 89. HelloController.groovy package foo class HelloController { def index = { } } ‣ hello = controller ‣ index = default action
  • 90. HelloController.groovy package foo class HelloController { def index = { } } ‣ hello = controller ‣ index = default action ‣ Convention over configuration grails-app/controllers/HelloController.groovy
  • 92. Invoking the controller http://localhost:8080/eop.lec9.demo/hello http://localhost:8080/eop.lec9.demo/hello/index ‣ No rendering is defined yet: HTTP Status 404 - /eop.lec9.demo/WEB-INF/grails-app/views/hello/index.jsp type Status report message /eop.lec9.demo/WEB-INF/grails-app/views/hello/index.jsp description The requested resource (/eop.lec9.demo/WEB-INF/grails-app/views/hello/index.jsp) is not available. Apache Tomcat/6.0-snapshot
  • 93. Invoking the controller http://localhost:8080/eop.lec9.demo/hello http://localhost:8080/eop.lec9.demo/hello/index ‣ No rendering is defined yet: HTTP Status 404 - /eop.lec9.demo/WEB-INF/grails-app/views/hello/index.jsp type Status report message /eop.lec9.demo/WEB-INF/grails-app/views/hello/index.jsp description The requested resource (/eop.lec9.demo/WEB-INF/grails-app/views/hello/index.jsp) is not available. Apache Tomcat/6.0-snapshot problem: we must define the view
  • 94. A simple action ‣ Action = closure class HelloController { ... def directText = { render "Hello World" } }
  • 95. A simple action ‣ Action = closure class HelloController { ... def directText = { render "Hello World" } } ‣ http://localhost:8080/eop.lec9.demo/hello/directText Hello World
  • 97. Another simple action ‣ Action = closure class HelloController { ... def withDate = { def now = new Date() render "Hello World at $now" } }
  • 98. Another simple action ‣ Action = closure class HelloController { ... def withDate = { def now = new Date() render "Hello World at $now" } } ‣ http://localhost:8080/eop.lec9.demo/hello/withDate Hello World at Mon May 03 02:38:03 CEST 2010
  • 99. But raw test is soon a bit rough...
  • 100. Enhanced web pages = dynamic html
  • 101. Controller/action ➙ Model (data) ➙ GSP (view)
  • 102. One action ↔ one GSP view
  • 103. GSP by default ‣ One controller = one directory in grails-app/views - foo.HelloController.groovy ➙ grails-app/views/hello/
  • 104. GSP by default ‣ One controller = one directory in grails-app/views - foo.HelloController.groovy ➙ grails-app/views/hello/ ‣ One action = one .gsp file - def index = {...} ➙ grails-app/views/hello/index.gsp
  • 105. GSP by default ‣ One controller = one directory in grails-app/views - foo.HelloController.groovy ➙ grails-app/views/hello/ ‣ One action = one .gsp file - def index = {...} ➙ grails-app/views/hello/index.gsp ‣ .gsp file: - pure html - dedicated tags - model variables can be passed
  • 106. A static gsp example (content is always the same)
  • 108. hello/index.gsp <html> <head> <title>Hello world index page</title> </head> <body> <h1>Welcome to hello world</h1> <ul> <li><a href="/eop.lec9.demo/hello/directText"> simple text hello</a></li> <li><a href="/eop.lec9.demo/hello/withDate"> text with date</a></li> </ul> </body> </html>
  • 109. Absolute path are not good practice use grails tag instead <g:link controller=”...” action=”...”>
  • 111. hello/index.gsp <ul> <li> <g:link controller="hello" action="directText"> simple text hello </g:link> </li> <li> <g:link controller="hello" action="withDate"> text with date </g:link> </li> </ul>
  • 112. hello/index.gsp <ul> <li> <g:link controller="hello" action="directText"> simple text hello </g:link> </li> <li> <g:link controller="hello" action="withDate"> text with date </g:link> </li> </ul> ‣ Documentation: http://grails.org/doc/latest/ ➙ tags
  • 113. Dynamic gsp content (model) is computed by the action
  • 114. Passing data to the .gsp ‣ A new action returning map of values def when = { def now = new Date() return [myTime:now] }
  • 115. Passing data to the .gsp ‣ A new action returning map of values def when = { def now = new Date() return [myTime:now] } ‣when.gsp <body> <h1>Current time is ${myTime}</h1> We are <b>${myTime.seconds}</b> seconds past the minute <hr/> <g:link controller="hello" action="index"> back home</g:link> </body>
  • 116.
  • 119. Passing arguments ‣http://.../hello/ago?nbdays=4 ‣ Controller access parameters through map params def ago = { def now = new Date() def d = now - (params.nbdays as Integer) [currentTime:now, pastTime:d] }
  • 120. Passing arguments ‣http://.../hello/ago?nbdays=4 ‣ Controller access parameters through map params def ago = { def now = new Date() def d = now - (params.nbdays as Integer) [currentTime:now, pastTime:d] } ‣ago.gsp Current time is ${currentTime}. <br/> It was ${pastTime}, ${params.nbdays} days ago
  • 121.
  • 122. How to call an action with parameters?
  • 124. Passing arguments statically ‣Through the url http://.../hello/ago?nbdays=4
  • 126. Passing arguments statically ‣ Within a <g:link> tag <li> <g:link controller="hello" action="ago" params="[nbdays:4]" >4 days ago</g:link> </li>
  • 127. Let the user set a parameter: <form>
  • 128. Passing arguments (cont’d) ‣ Within a user entered <form> <g:form controller="hello" action="ago"> <!-- default value is the one received from params.nbdays --> <g:textField name="nbdays" value="${params.nbdays}" /> <g:submitButton name="submit" value="new date"/> </g:form>
  • 129. Passing arguments (cont’d) ‣ Within a user entered <form> <g:form controller="hello" action="ago"> <!-- default value is the one received from params.nbdays --> <g:textField name="nbdays" value="${params.nbdays}" /> <g:submitButton name="submit" value="new date"/> </g:form> ‣ The form is included here in the ago.gsp
  • 130. Passing arguments (cont’d) ‣ Within a user entered <form> <g:form controller="hello" action="ago"> <!-- default value is the one received from params.nbdays --> <g:textField name="nbdays" value="${params.nbdays}" /> <g:submitButton name="submit" value="new date"/> </g:form> ‣ The form is included here in the ago.gsp ‣ Could be in another gsp file (with a static default value)
  • 131. Model - View - Controller

Editor's Notes

  1. new round starting web application\nGoal: to build a twitter like application\ntoday is an introduction to web application\n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. Pervert use of task to remember what you want to remember\n!!Moderate use of FIXME\n\n
  8. Pervert use of task to remember what you want to remember\n!!Moderate use of FIXME\n\n
  9. Pervert use of task to remember what you want to remember\n!!Moderate use of FIXME\n\n
  10. ctrl F7\nof lower left button to open a view\nclose you projects\nview is just one box, a perspective (upper right corner) is a arrangement of views\nTasks on server: trac, mantis &lt;-&gt; tickets (bug, features etc.)\n
  11. ctrl F7\nof lower left button to open a view\nclose you projects\nview is just one box, a perspective (upper right corner) is a arrangement of views\nTasks on server: trac, mantis &lt;-&gt; tickets (bug, features etc.)\n
  12. ctrl F7\nof lower left button to open a view\nclose you projects\nview is just one box, a perspective (upper right corner) is a arrangement of views\nTasks on server: trac, mantis &lt;-&gt; tickets (bug, features etc.)\n
  13. Example: your parse SwissProt from text format for getting AC and sequence, then, your are asked to read for splicing info =&gt; you text parsing get more and more complex\nJumping to xml parsing is an investment (you loose one day coming back to the same point), but you&amp;#x2019;ll move faster further on.\n
  14. Example: your parse SwissProt from text format for getting AC and sequence, then, your are asked to read for splicing info =&gt; you text parsing get more and more complex\nJumping to xml parsing is an investment (you loose one day coming back to the same point), but you&amp;#x2019;ll move faster further on.\n
  15. Example: your parse SwissProt from text format for getting AC and sequence, then, your are asked to read for splicing info =&gt; you text parsing get more and more complex\nJumping to xml parsing is an investment (you loose one day coming back to the same point), but you&amp;#x2019;ll move faster further on.\n
  16. html javascript css form\nanchor query argument\nGET/POST\nimages\nservlet CGI\najax flash\napache / tomcat\n\n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. Application is not a weekly TP just enforced by a series of test\nThe application must go public, to be used by the (lab) customer\nFind the easiest way to deploy you app\n
  45. Install groovy, copy jars\nCall the scripts =&gt; teach your user\nWindows is catastrophic for command line\nHowever, script can be the solution for high volumes (biologist can learn...)\n
  46. Griffon (swing based)\nStill need to install software on customer machine\nSoftware update to take into account (JNLP is a solution)\nFull access to the user&amp;#x2019;s machine\nStandalone solution\n
  47. GUI: Graphical User Interface\nEveryone has a browser\nnetwork is fast\nExample: gmail, google map etc.\nJavascript/Ajax turn the browser into a user friendly experience\nFlash: little limits compared to a native GUI (not on the iPhone/iPad family...). Can grant acces to the host computer resources\nEasy to deploy (everyone&amp;#x2019;s connected)\nEasy updates\nCan install a server on the customer machines\n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. All the web application architecture is ready\nConfiguration at it simplest level (convention over configuration)\ndomain (database stored beans)\nplugin oriented to enrich the app\nSTS integration\n
  54. High changing pace in the versions, keep up to date...\n
  55. High changing pace in the versions, keep up to date...\n
  56. High changing pace in the versions, keep up to date...\n
  57. High changing pace in the versions, keep up to date...\n
  58. High changing pace in the versions, keep up to date...\n
  59. Version field is set automatically\n
  60. a very common command call, so better configure it as a simple shortcut\n
  61. a very common command call, so better configure it as a simple shortcut\n
  62. a very common command call, so better configure it as a simple shortcut\n
  63. equivalent to command line\nexport GRAILS_HOME=/path/to/installed/grails-x.y.z\nexport PATH=$PATH:$GRAILS_HOME/bin\ngrails create-app eop.lec9.demo\n
  64. + some optional directories\ntoday : only controller &amp; view\n&amp;#x201C;we&amp;#x2019;ll see that later&amp;#x201D; will be the most commonly used word today...\n\n
  65. + some optional directories\ntoday : only controller &amp; view\n&amp;#x201C;we&amp;#x2019;ll see that later&amp;#x201D; will be the most commonly used word today...\n\n
  66. Port 80 by default http://localhost\nPort &lt;1024 traditionally reserved to root\nModifying the code (to some extent) does not require to re-start the server (wait 2 seconds)\nIt is not possible to launch twice the application (port conflict). Must kill before relaunching if ever\n
  67. Port 80 by default http://localhost\nPort &lt;1024 traditionally reserved to root\nModifying the code (to some extent) does not require to re-start the server (wait 2 seconds)\nIt is not possible to launch twice the application (port conflict). Must kill before relaunching if ever\n
  68. Port 80 by default http://localhost\nPort &lt;1024 traditionally reserved to root\nModifying the code (to some extent) does not require to re-start the server (wait 2 seconds)\nIt is not possible to launch twice the application (port conflict). Must kill before relaunching if ever\n
  69. Versions are displayed (grails, your application)\nList of plugins used by default (we&amp;#x2019;ll add some more later)\n
  70. \n
  71. &lt;ctrl&gt;&lt;alt&gt;G create-controller foo.hello \nDo not forget to refresh eclipse after each command line action (F5) or right-button &gt; refresh\n\n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. Test is ready, but we&amp;#x2019;re not yet there!\n
  97. \n
  98. Convention is the naming of file, instead of description in configuration files + class inheritance\n
  99. Convention is the naming of file, instead of description in configuration files + class inheritance\n
  100. Convention is the naming of file, instead of description in configuration files + class inheritance\n
  101. Convention is the naming of file, instead of description in configuration files + class inheritance\n
  102. index is by default (we&amp;#x2019;ll see the configuration later)\n
  103. index is by default (we&amp;#x2019;ll see the configuration later)\n
  104. No need to relaunch the application when you add action or controllers\n\n
  105. No need to relaunch the application when you add action or controllers\n\n
  106. \n
  107. \n
  108. \n
  109. Before going to more complex action (we have not talked about parameters). let&amp;#x2019;s make a tour on view\nText is maybe not always enough\nWhat do you know of html?\n\n
  110. \n
  111. This is a little bit too simplistic, as we can have in practice one GSP for multiple actions, or an action can be redirected towards one or another view depending on the context\n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. actions directText &amp; withDate do not have .gsp as they render directly text\n
  119. actions directText &amp; withDate do not have .gsp as they render directly text\n
  120. \n
  121. ${...} extrapolate groovy expression (just as in a println statement)\nNote the link back to home page\nOf course, it is possible to pass more than one variable in the returned map\n
  122. ${...} extrapolate groovy expression (just as in a println statement)\nNote the link back to home page\nOf course, it is possible to pass more than one variable in the returned map\n
  123. \n
  124. \n
  125. Parameters are passed as map of string\nNote that we can still access params within the gsp\n
  126. Parameters are passed as map of string\nNote that we can still access params within the gsp\n
  127. Parameters are passed as map of string\nNote that we can still access params within the gsp\n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. One of the most commons software architecture design pattern\nShare responsibility among each components\nModel is far more than just some data exchanged between the controller and the view (we see that later)\n\n