The document introduces Grails and Groovy by providing an overview of the key concepts and features. It discusses how Grails allows for rapid application development using conventions over configuration. The Grails stack is built on top of Java and includes frameworks like Spring, Hibernate and Groovy. It demonstrates creating a Grails application, the directory structure, GORM for object-relational mapping, querying, controllers and views using GSP and taglibs. Plugins are mentioned as a way to extend functionality.
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