Getting started with Grails


Getting started with Grails

 

Rapid Web Development for the Java Platform

Getting Started with Grails Rapid Web Development for the Java Platform Presented at the Princeton Java Users Group June 5th, 2007 1 ? This presentation is published under the Creative Commons Attribution Noncommercial Share Alike License Version 2.5. (Please see http://creativecommons.org/licenses/by-nc-sa/2.5/ for complete details.) ? You are free to reuse and modify this presentation under the following conditions. (Thanks to Steven Devijver for providing this excellent summary of the license terms.): ? You don?t get compensated for providing this presentation (non-commercial). ? You don?t get compensated for presenting this presentation in front of your audience (non- commercial). You are exempted from this condition if you are tutoring your colleagues. ? You do not charge members of your audience for a digital copy of this presentation. ? You are free to charge your audience for printed versions of this presentation or for the media that contains this presentation, but only if you personally actually incur a non- recoverable cost. ? You keep and do not modify the content of this license slide in the presentation (share alike). ? You attribute that Jason Rudolph is the original creator and maintainer of this presentation (attribution). ? If you modify the content and distribute or modify the content and show this presentation to an audience, you are required to send your modified file to contact@jasonrudolph.com. ? You have the right to call yourself co-author if you modify the content of this presentation in a non-trivial way. ? If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one (share alike). Creative Commons License 2 Introduction ? Jason Rudolph ? Grails Committer ? Software Consultant ? Author 3 ? Grails? What?s that? ? Hello, Productivity ? Painless ORM (Seriously) ? Validation Made Simple ? A New Point of View ? Cool (and Groovy) Features ? Test, Deploy, Profit! Agenda 4 ? Rapid web application development ? Getting things done ? Having fun doing it ? Full-stack MVC framework ? Open source ? Runs on the JVM What is Grails? 5 ? Develop your apps in Groovy ? Convention over configuration ? Opinionated software ? Sensible defaults ? Everything has a place ? DRY (Don't Repeat Yourself) What (else) is Grails? 6 Rock-Solid Foundation 7 ? Ready? ? Install JDK 1.4 (or higher) ? Set JAVA_HOME ? Set ? Download latest Grails release ? Set GRAILS_HOME ? Add $GRAILS_HOME/bin to your PATH Let's Get Started 8 Hello, Grails Demo 9 What?s Inside? 10 Demo Instant Gratification 11 ? Zero-configuration persistence management ? DAOs Dynamic domain class methods Grails ORM (GORM) ? save ? delete ? get ? list ? find ? findAll ? count ? etc. 12 Relationship Counseling 13 1:n Relationships class Race { //... static hasMany = [registrations:Registration] } class Registration { //... Race race static belongsTo = Race } 14 Relationship Counseling Demo 15 Where?s My Data? 16 Be Persistent Demo 17 ? Pre-packaged constraints ? Custom constraints Declaring Constraints ? blank ? creditcard ? email ? inList ? min ? max ? matches ? nullable ? range ? unique ? url ? etc. 18 Show Some Constraint! Demo 19 Fun with URLs http://localhost:8080/racetrack/race/show/2 20 Fun with URLs http://localhost:8080/racetrack/race/show/2 class RaceController { //... def show = { [ race : Race.get( params.id ) ] } //... } 21 GSP 22 GSP def show = { [ race : Race.get( params.id ) ] } RaceController.groovy <g:each var="r" in="${race.registrations}"> <li> <g:link controller="registration" action="show" id="${r.id}">${r.name} </g:link> </li> </g:each> views/race/show.gsp 23 ? What if I need to... ? find all races in New Jersey? ? count the races longer than 10 km? ? get a list of the 10 longest races? ? find races matching a certain pattern? ? list all races with registrations? Get Dynamic Dynamic Finder Methods 24 Get Dynamic Demo 25 ? Unit testing ? GroovyTestCase created for each class ? grails test-app executes all test cases ? Functional testing ? Canoo Web Test ? grails generate-webtest ? grails run-webtest Putting It to the Test 26 Deployment grails war 27 ? Services ? transactional ? non-transactional ? Java Integration (src/java) ? Rich (and Friendly) Tag Libraries ? Ajax Beyond the Finish Line 28 ? Custom URL Mapping ? Alternate Domain Implementations ? Using Hibernate XML for legacy schemas ? EJB3 entity beans ? Command Objects for Forms ? Job Scheduling ? Layouts & CSS Still More to Explore 29 ? Build rich clients ? Expose web services ? Secure your app ? Roll your own scaffolding ? Integrate a search engine ? Almost limitless possibilities grails.org/plugins 30 ? Future releases (Pre 1.0) ? Support for JSP custom tag libraries in GSP ? Spring Web Flow ? Domain model generation from database schema ? JPA support grails.org/roadmap 31 ? Oracle ? BEA ? Sun (JavaOne 2007) Important Companies Talking About Grails http://www.oracle.com/technology/pub/articles/grall- grails.html http://dev2dev.bea.com/pub/a/2006/10/introduction- groovy-grails.html http://www28.cplan.com/cc158/session_details.jsp? isid=286133&ilocation_id=158-1&ilanguage=english 32 ? grails.org ? Downloads ? Latest release (0.5) ? Development snapshot (0.5.5) ? User guide, tutorials, screencasts, etc. ? Mailing lists (grails.org/mailing+lists) Resources 33 aboutGroovy.com grails.org/grails+podcast groovyblogs.org Resources (cont?d) 34 2007 No Fluff Just Stuff Atlantic Northeast Software Symposium August 10-12th Westin Princeton at Forrestal Village nofluffjuststuff.com/sh/2007-08-princeton 35 Grails eXchange 2007 October 17-19th Barbican, London, UK grails-exchange.com 36 Books 37 www.jasonrudolph.com jason@jasonrudolph.com 38

PARTAGER SUR

Envoyer le lien par email
1753
READS
3
DOWN
7
FOLLOW
3
EMBED
DOCUMENT # TAGS
#web developpement  #grails  #java 

licence non indiquée


DOCUMENT # INDEX
WEB 
img

Partagé par  carla

 Suivre

Auteur:jason rudolph
Source:www.jasonrudolph.com