Practical Grails
Upcoming SlideShare
Loading in...5
×
 

Practical Grails

on

  • 3,023 views

Grails presentation given at Denver Open Source User Group April 2009

Grails presentation given at Denver Open Source User Group April 2009

Statistics

Views

Total Views
3,023
Views on SlideShare
2,978
Embed Views
45

Actions

Likes
0
Downloads
34
Comments
0

6 Embeds 45

http://scottryansblog.blogspot.com 35
http://www.slideshare.net 5
http://www.linkedin.com 2
http://static.slidesharecdn.com 1
https://www.linkedin.com 1
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Practical Grails Practical Grails Presentation Transcript

  • Practical Grails Denver Open Source User's Group April 2009 Scott Ryan Soaring Eagle L.L.C. [email_address]
  • Agenda
    • Grails Overview
    • Grails Architecture
    • Domain Layer
    • Controller Layer
    • Service Layer
    • Presentation Layer
    • Build, Develop and Deploy
    • Security
    • Plugins
  • Overview
    • Groovy Based
    • Convention over configuration
    • Don’t Repeat Yourself (DRY)
    • Lots of code generation and scaffolding
    • Leverages Leading Java Frameworks
      • Spring, Hibernate, Quartz, JSP, Ajax, Sitemesh,...
  • Overview
    • Wide IDE Support
      • Intellij, Netbeans, Eclipse, ....
    • Wide Server Support
      • Jetty, Tomcat, Websphere, Weblogic, Glassfish, Geronimo
    • Very Dynamic development Environment
    • Two Current Versions
      • 1.0.4 (Groovy 1.5) and 1.1 (Groovy 1.6)
    • Huge Productivity Benefits
    • Leverages Java and JVM (Scalable)
  • Demo
    • Trading system
  • Architecture
    • Domain Layer
      • Gorm
    • Controller Layer
    • Service Layer
    • Presentation Layer
    • Configuration Layer
    • Environment and Build layer
    • Plugin Layer
  • Domain Sample Code
    • Sample Domain Code
      • Column Definition
      • Relationships (one to one, many to many, etc.)
        • BelongsTo
      • Constraints
      • Custom Hibernate Definitions
        • Indexes ( Simple or Complex ), Blobs
      • Base Domain Class
  • Reference Data Handling
    • Table Based
      • One or many
    • String Based
    • Enum Based
      • 1.0.4 Stores Ordinal
        • Temporary trick
      • 1.1 Can store String
    • Plugins
  • Domain Environment Setup
    • Based on environment
      • Runtime or Build controlled
    • Sample Configuration File
    • Sample Bootstrap File
  • Transactions
    • Uses Open Session in View
      • Modify data with care (discard)
    • Spring Controlled Transactions
    • Can open transactions manually
    • Complex Transactions best done in Service layer
    • Batch inserts are problematic but easily addressed
  • Queries
    • Dynamic Generated GORM Queries
      • Simple and compound
    • Criteria Framework
      • Sorting
    • Hand Coded SQL
      • Hibernate Based
      • Custom SQL
  • Criteria Query
    • // returns first 10 users who have an active
    • // account that has been created in the last
    • // 30 days and that have Grails-like
    • // bookmarks created in the last 7 days
    • def now = new Date()
    • def users = Bookmark.withCriteria {
    • comments {
    • like( "text" , "%Grails%" )
    • between( "dateCreated" , now- 7 , now)
    • }
    • between( "dateCreated" ,now- 30 , now)
    • maxResults( 10 )
  • Controllers
    • Should be light weight
    • Push business logic to the service layer
    • Remember security as REST is king
    • Download and upload is supported
    • Graphics and Reporting
  • Service Layer
    • Reusable business logic
    • Complex transactions
    • Can be injected anywhere
      • Domain, Controller, View
    • Spring Beans
  • Presentation Layer
    • Layouts
    • Templates
    • Tags
    • Link Building
    • Images and CSS
    • Custom Taglibs
  • Ajax
    • Built in with prototype
    • Can use other frameworks
    • Best practices to use shared templates
  • Build and Configuration
    • Multiple Environments
      • 3 defaults
    • Gant Based and Maven (1.1)
    • BIG War's but can make them smaller with some work
    • Lots of targets
  • Security
    • Use a framework to start
    • Remember this is a REST Application
    • Leverage Custom filters
    • Encrypt what you need to
  • Plugins
    • Framework for adding functionality
    • Can be used to optimize applications
    • Can be used to add functionality to base framework
    • Easy to install
      • 1.1 improves the architecture
    • Hard to tell what is useful and supported
  • Favorite Plugins
    • Spring Security
    • Quartz
    • Grails UI and Charting
    • Mail
    • Settings
    • Help Balloons
    • mor.ph
    • Testing (Included in 1.1)
  • Questions
    • Contact Me
      • Scott Ryan
      • [email_address]
      • www.soaringeagleco.com