Your SlideShare is downloading. ×
0
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Grails TV : an introduction into Grails & Groovy
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Grails TV : an introduction into Grails & Groovy

1,911

Published on

An introduction into Grails & Groovy

An introduction into Grails & Groovy

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,911
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
42
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Hello everybody, today I’m to going explain Grails & Groovy by introducing Grails\n\n\n
  • What are we’re doing to this afternoon?\n\n- First a little bit about myself\n\n- Grails TV, what is exactly Grails TV?\n\n- introduction into Groovy\n\n- and an introduction into Grails\n\n- and finally we’re going to create an app!\n\n
  • What are we’re doing to this afternoon?\n\n- First a little bit about myself\n\n- Grails TV, what is exactly Grails TV?\n\n- introduction into Groovy\n\n- and an introduction into Grails\n\n- and finally we’re going to create an app!\n\n
  • What are we’re doing to this afternoon?\n\n- First a little bit about myself\n\n- Grails TV, what is exactly Grails TV?\n\n- introduction into Groovy\n\n- and an introduction into Grails\n\n- and finally we’re going to create an app!\n\n
  • What are we’re doing to this afternoon?\n\n- First a little bit about myself\n\n- Grails TV, what is exactly Grails TV?\n\n- introduction into Groovy\n\n- and an introduction into Grails\n\n- and finally we’re going to create an app!\n\n
  • \n\nIt started all with this Commodore VIC-20 back in the 80’s.. Started hacking some small programs...and I learned different programming languages : Basic, Pascal, Modula, Delphi, Java...and in the end Groovy & Grails\n\n
  • My first project with Grails & Groovy : Fast Food Friday. The company I work for, we have a Fast Food Friday\nBut ordering the food was always a problem! So this was a great oppertunity to create my first Grails application : Fast Food Manager (or in dutch Vettebek Manager)\n
  • The last two years, I’m also giving presentation about Grails & Groovy.. Last year I started HTML5 User Group, organized a HTML5 Hackathon, and HTML5 workshop for scholers!\n
  • The last two years, I’m also giving presentation about Grails & Groovy.. Last year I started HTML5 User Group, organized a HTML5 Hackathon, and HTML5 workshop for scholers!\n
  • \n
  • Google TV .... a new experience that combines TV, the entire web, and apps...very cool... introduced last year\nbut when will it arrive?\n\ni\n
  • So... let’s not wait for Google ... just create it do day!\n\nLet’s build it with GRAILS... Grails is a dynamic web framework based on the language Groovy\n\nSo first we dive into Groovy.\n\n
  • Groovy is a popular dynamic language for the Java Virtual Machine. It’s inspired by languages like Python, Ruby and Smalltalk.\n\nIt makes modern programming features available to Java developers. \nFeatures like closures, dynamic methods. It supports Domain Specifice Languages and it simplifies testing.\n
  • Is there someone who can read this slide? Doesn’t matter.. \n\nAll this code is needed for reading a file and output it line by line\n\nThere is a better solution:\n
  • In Groovy all you need is this\n
  • Every modern language nowadays has the construct of a closure, like Javascript, Scala, Python.etc... but not Java... and it will be question if it ever will come..\n\nBut a closure is very neat\n
  • A closure is just a block of code .\n\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • class Dog {\n def bark() { println "woof!" }\n def sit() { println "(sitting)" }\n def jump() { println "boing!" }\n}\n\ndef doAction( animal, action ) {\n animal."$action"() //action name is passed at invocation\n}\n\ndef rex = new Dog()\n\ndoAction( rex, "bark" ) //prints 'woof!'\ndoAction( rex, "jump" ) //prints 'boing!'\n\n\ndef builder = new groovy.xml.MarkupBuilder()\nbuilder.'web-app' {\n 'display-name' 'My Web Application'\n}\n\n
  • class Dog {\n def bark() { println "woof!" }\n def sit() { println "(sitting)" }\n def jump() { println "boing!" }\n}\n\ndef doAction( animal, action ) {\n animal."$action"() //action name is passed at invocation\n}\n\ndef rex = new Dog()\n\ndoAction( rex, "bark" ) //prints 'woof!'\ndoAction( rex, "jump" ) //prints 'boing!'\n\n\ndef builder = new groovy.xml.MarkupBuilder()\nbuilder.'web-app' {\n 'display-name' 'My Web Application'\n}\n\n
  • Grails is a next-generation Java web development framework that generates great developer productivity gains through the confluence of a dynamic language\n
  • 2005 Ruby on Rails is all the rage these days, but compromise on your past investment..\n\n\nCan’t we leverage Groovy and proven technologies like Spring and Hibernate to bring the “Convention over Configuration” paradigm on the Java platform, without compromising on your investment?”\n\nConvention over Configuration\nScaffolding\nCode Templates\neasy database configuration\n
  • but the main goal : simplify the life of developers\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Spring : IoC, DI, Spring MVC, Spring Webflow\nHibernate : Object-Relational Mapping\nTomcat : application server\n\n
  • Spring : IoC, DI, Spring MVC, Spring Webflow\nHibernate : Object-Relational Mapping\nTomcat : application server\n\n
  • Spring : IoC, DI, Spring MVC, Spring Webflow\nHibernate : Object-Relational Mapping\nTomcat : application server\n\n
  • Spring : IoC, DI, Spring MVC, Spring Webflow\nHibernate : Object-Relational Mapping\nTomcat : application server\n\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Known as domain classes in Grails, represent the problem domain\n
  • \n
  • \n
  • \n
  • your domain model is a set of POGO’s\n\nyour domain class are transparentely mapped to the datase\n\nHibernate under the hood\n
  • \n
  • \n
  • \n
  • \n
  • control request flow, interact with models and delegate to views\n
  • - controllers return a Map as models for the view to render\n\n- easy databinding from from fields\n
  • - controllers return a Maps as models for the view to render\n\n- easy databinding from from fields\n
  • are defined in Groovy Server Pages to render the model\n
  • \n
  • \n
  • \n
  • - controllers return a Maps as models for the view to render\n\n- easy databinding from from fields\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. Grails & Groovy introducing Grails TV Take the tour
    • 2. To do A little about myself Grails TV Groovy Grails grails create-app
    • 3. To do A little about myself Grails TV Groovy Grails grails create-app
    • 4. To do A little about myself Grails TV Groovy Grails grails create-app
    • 5. To do A little about myself Grails TV Groovy Grails grails create-app
    • 6. To do A little about myself Grails TV Groovy Grails grails create-app
    • 7. Fast Food Friday
    • 8. http://www.ihenk.com @henkjurrienshenk.jurriens@gmail.com
    • 9. 01 1? LL 2FA
    • 10. Groovy
    • 11. package com.groovy.home;import java.io.BufferedReader;import java.io.FileNotFoundException;import java.io.FileReader;import java.io.IOException;public class TestFile {public static void main(String[] args){ BufferedReader br=null; try{ br=new BufferedReader(new FileReader("test.txt")); String line=null; while((line=br.readLine())!=null){ System.out.println(line); } } catch(FileNotFoundException e){ e.printStackTrace(); } catch(IOException e) { e.printStackTrace(); } }}
    • 12. new File("test.txt").eachLine{ line -> println line}
    • 13. Closures
    • 14. def x = 2def c = { numberToSquare -> numberToSquare * numberToSquere}def y = c(x)
    • 15. Collections
    • 16. Listsdef list = [ 5, 6, 7, 8 ]list.each{ println it}
    • 17. Mapsdef map = [ name: “henk” , likes : “cheese” ]assert map.get(“name”) == “henk”
    • 18. • find• findAll• sort• sum
    • 19. otherfeatures
    • 20. Dynamic Methods
    • 21. class Dog { def bark() { println "woof!" } def sit() { println "(sitting)" } def jump() { println "boing!" }}def doAction( animal, action ) { Dynamic Methods animal."$action"()}def rex = new Dog()doAction( rex, "bark" )
    • 22. XMLBuilders
    • 23. def builder = newgroovy.xml.MarkupBuilder()builder.web-app { XMLBuilders display-name My Web Application}
    • 24. Convention over Configuration
    • 25. Simplify the life of developers
    • 26. =
    • 27. =
    • 28. =+
    • 29. =+
    • 30. =++
    • 31. =++
    • 32. Spring
    • 33. SpringHibernate
    • 34. SpringHibernateSiteMesh
    • 35. SpringHibernateSiteMeshTomcat
    • 36. Grails Stack Java Virtual Machine
    • 37. Grails StackJava Language Java Virtual Machine
    • 38. Grails Stack Java Development KitJava Language (JDK) Java Virtual Machine
    • 39. Grails StackJava Enterprise Edition (JEE) Java Development Kit Java Language (JDK) Java Virtual Machine
    • 40. Grails StackJava Enterprise Spring Edition (JEE) Java Development Kit Java Language (JDK) Java Virtual Machine
    • 41. Grails StackJava Enterprise Spring Hibernate Edition (JEE) Java Development Kit Java Language (JDK) Java Virtual Machine
    • 42. Grails StackJava Enterprise Spring Hibernate SiteMesh Edition (JEE) Java Development Kit Java Language (JDK) Java Virtual Machine
    • 43. Grails StackJava Enterprise Spring Hibernate SiteMesh Groovy Edition (JEE) Java Development Kit Java Language (JDK) Java Virtual Machine
    • 44. Grails Stack GrailsJava Enterprise Spring Hibernate SiteMesh Groovy Edition (JEE) Java Development Kit Java Language (JDK) Java Virtual Machine
    • 45. grails create-app gtv
    • 46. grails-app domain controllers views services taglib i18n
    • 47. Wait!
    • 48. Wait!Configuration files?
    • 49. Wait! Configuration files?no database to configure?
    • 50. Wait! Configuration files?no database to configure? no app server to install?
    • 51. Models
    • 52. class Movie { String title String description String image Integer rating String movie}
    • 53. static constraints = { title(blank:false) description(size:10..200) rating(min:1, max:5)}
    • 54. • blank • inList• email • nullable• url • min• range • scale
    • 55. GORM
    • 56. • Movie.count() • Movie.save()• Movie.list() • Movie.delete()• Movie.get(id) • etc
    • 57. Querying
    • 58. • find • countBy• findAllBy • list• count • listOrderby
    • 59. def m = Movie.findByTitle(‘Star trek’)m = Movie.findByRating(4)m = Movie. findByReleaseDateBetween(..,..)
    • 60. Controllers
    • 61. http://srvr:8080/app/controller/action
    • 62. Movie.properties = params
    • 63. Views
    • 64. Groovy Server Pages
    • 65. Groovy Server Pages Grails Tag Libs
    • 66. Groovy Server Pages Grails Tag LibsTemplates, URL mapping
    • 67. <g:render template="menu"/><g:each in="${content}" var="item"><g:link action="detail" id="${item.id}" > </g:link> <h2>${item.title}</h2></g:each>
    • 68. Plugins
    • 69. > 500 plugins
    • 70. > 500 plugins Security &authentication
    • 71. > 500 plugins Security &authentication Scheduling
    • 72. > 500 plugins Security &authentication jQuery Scheduling
    • 73. > 500 plugins Security &authentication jQuery Scheduling Google App Engine
    • 74. > 500 plugins Security &authentication jQuery Scheduling CouchDB Google App Engine
    • 75. Let’s build GTV!
    • 76. http://www.grails.orghttp://groovy.codehaus.org/

    ×