SlideShare uma empresa Scribd logo
1 de 15
Baixar para ler offline
Grails 101


     Lim Chee Kin
     limcheekin@vobject.com
     http://limcheekin.blogspot.com
About Me
●   Moderator of the Malaysia Groovy and Grails User Group
●   Involved in Grails development since version 0.6 and
    developed 15 Grails plugins to date
●   10+ years experience in software development and
    solution consulting for Java EE platform
●   Experience spans across various industries, including
    retail sector, telecommunication, heath care and
    financial services industry.
●   Experienced in many frameworks and web technologies,
    including Java EE, SpringFramework, Hibernate, Groovy,
    Grails Framework, Web Services, JQuery, JQuery UI
Why Grails

●


●


●   To practice agile development process you
    need an agile framework.
Inside Grails
●   Seamless integration of ...
●   Groovy                ●   Tomcat
●   Java                  ●   Ant
●   SpringFramework       ●   Maven
●   Hibernate             ●   Log4J
●   Java EE               ●   H2 Database
●   Sitemesh              ●   Quartz
●   JQuery                ●   ... many more
Best Practices Support
●   Convention over Configuration         standard directory
    structure

●   Dependency Injection SpringFramework
●   Model domain class View GSP Controller groovy class
●   Test Automation JUnit, Spock
●   Modularization plugin system
●   Code Generation scaffolding
●   Fast Development Cycle dynamic reloading
Running Grails App in 5 minutes

●   Step 1: grails create-app addressbook
●


●   Step 2: grails create-domain-class Person
●


●   Step 3: grails generate-all Person
●


●   Step 4: grails run-app
Step 1: grails create-app addressbook
●   Created Grails Application at /opt/dev/ws/addressbook
Step 1: grails create-app addressbook
    /addressbook
●     application.properties
●     grails-app/conf/            --> location of configuration artifacts
●     grails-app/conf/hibernate   --> optional hibernate config
●     grails-app/conf/spring      --> optional spring config
●     grails-app/controllers/     --> location of controller artifacts
●     grails-app/domain/          --> location of domain classes
●     grails-app/i18n/            --> location of message bundles for i18n
●     grails-app/services/        --> location of services
●     grails-app/taglib/          --> location of tag libraries
●     grails-app/utils/           --> location of grails specific utility classes
●     grails-app/views/           --> location of views
●     grails-app/views/layouts    --> location of layouts
●     lib/                        --> jar files not available via installed plugins
●     scripts/                    --> scripts
●     src/groovy                  --> optional; location for Groovy source files (of types
                                      other than those in grails-app/*)
●     src/java                    --> optional; location for Java source files
●     test/                       --> test classes
●     web-app/                    --> css, images, etc, etc, etc.
Step 2: grails create-domain-class Person
●   Created file grails-app/domain/addressbook/Person.groovy
    Created file test/unit/addressbook/PersonTests.groovy
●

●   class Person {
●    String firstName
●    String lastName
●    Date dateOfBirth
●    Integer age
●

●       static constraints = {
●        firstName(nullable:true, maxSize:60)
●        lastName(nullable:true, maxSize:30)
●        dateOfBirth(nullable:true, maxSize:10)
●        age(nullable:true)
●        }
●   }
Step 3: grails generate-all Person
●   Finished generation for domain class addressbook.Person
Step 4: grails run-app
Server running. Browse to http://localhost:8080/addressbook
Step 4: grails run-app
Step 4: grails run-app
My Open Source Grails Plugins
●   I contributed 15 Grails plugins out of 826
    (13 Aug 2012), including:
●   Grails Activiti Plugin
●   http://code.google.com/p/grails-activiti-plugin/
●   Grails Form Builder Plugin
●   http://code.google.com/p/grails-form-builder-plugin/
●   JQuery Validation UI Plugin
●   http://grails.org/plugin/jquery-validation-ui
●   Mahout Recommender Plugin
●   https://github.com/limcheekin/mahout-recommender

●   Find out more at http://goo.gl/VPVrd
Q&A

Mais conteúdo relacionado

Semelhante a Grails 101

Groovy shell scripting
Groovy shell scriptingGroovy shell scripting
Groovy shell scriptingGeorg Berky
 
Inrotograils 140211155206-phpapp01
Inrotograils 140211155206-phpapp01Inrotograils 140211155206-phpapp01
Inrotograils 140211155206-phpapp01Hiten Pratap Singh
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & DependeciesÉdipo Souza
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers WorkshopJody Garnett
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation ToolIzzet Mustafaiev
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
GlusterFS Containers
GlusterFS ContainersGlusterFS Containers
GlusterFS ContainersMohamed Ashiq
 
Develop Android/iOS app using golang
Develop Android/iOS app using golangDevelop Android/iOS app using golang
Develop Android/iOS app using golangSeongJae Park
 

Semelhante a Grails 101 (20)

Grails
GrailsGrails
Grails
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Groovy and noteworthy
Groovy and noteworthyGroovy and noteworthy
Groovy and noteworthy
 
Grails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLTGrails 1.4.0.M1 メモLT
Grails 1.4.0.M1 メモLT
 
Groovy shell scripting
Groovy shell scriptingGroovy shell scripting
Groovy shell scripting
 
Inrotograils 140211155206-phpapp01
Inrotograils 140211155206-phpapp01Inrotograils 140211155206-phpapp01
Inrotograils 140211155206-phpapp01
 
Introduction to Grails
Introduction to GrailsIntroduction to Grails
Introduction to Grails
 
Groovy & Grails
Groovy & GrailsGroovy & Grails
Groovy & Grails
 
Introduction to Grails
Introduction to GrailsIntroduction to Grails
Introduction to Grails
 
Android, Gradle & Dependecies
Android, Gradle & DependeciesAndroid, Gradle & Dependecies
Android, Gradle & Dependecies
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
Gradle - the Enterprise Automation Tool
Gradle  - the Enterprise Automation ToolGradle  - the Enterprise Automation Tool
Gradle - the Enterprise Automation Tool
 
Grails 101
Grails 101Grails 101
Grails 101
 
Gluster containers!
Gluster containers!Gluster containers!
Gluster containers!
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Grails Spring Boot
Grails Spring BootGrails Spring Boot
Grails Spring Boot
 
GlusterFS Containers
GlusterFS ContainersGlusterFS Containers
GlusterFS Containers
 
Develop Android/iOS app using golang
Develop Android/iOS app using golangDevelop Android/iOS app using golang
Develop Android/iOS app using golang
 
Whats New In Groovy 1.6?
Whats New In Groovy 1.6?Whats New In Groovy 1.6?
Whats New In Groovy 1.6?
 

Último

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Último (20)

Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Grails 101

  • 1. Grails 101 Lim Chee Kin limcheekin@vobject.com http://limcheekin.blogspot.com
  • 2. About Me ● Moderator of the Malaysia Groovy and Grails User Group ● Involved in Grails development since version 0.6 and developed 15 Grails plugins to date ● 10+ years experience in software development and solution consulting for Java EE platform ● Experience spans across various industries, including retail sector, telecommunication, heath care and financial services industry. ● Experienced in many frameworks and web technologies, including Java EE, SpringFramework, Hibernate, Groovy, Grails Framework, Web Services, JQuery, JQuery UI
  • 3. Why Grails ● ● ● To practice agile development process you need an agile framework.
  • 4. Inside Grails ● Seamless integration of ... ● Groovy ● Tomcat ● Java ● Ant ● SpringFramework ● Maven ● Hibernate ● Log4J ● Java EE ● H2 Database ● Sitemesh ● Quartz ● JQuery ● ... many more
  • 5. Best Practices Support ● Convention over Configuration standard directory structure ● Dependency Injection SpringFramework ● Model domain class View GSP Controller groovy class ● Test Automation JUnit, Spock ● Modularization plugin system ● Code Generation scaffolding ● Fast Development Cycle dynamic reloading
  • 6. Running Grails App in 5 minutes ● Step 1: grails create-app addressbook ● ● Step 2: grails create-domain-class Person ● ● Step 3: grails generate-all Person ● ● Step 4: grails run-app
  • 7. Step 1: grails create-app addressbook ● Created Grails Application at /opt/dev/ws/addressbook
  • 8. Step 1: grails create-app addressbook /addressbook ● application.properties ● grails-app/conf/ --> location of configuration artifacts ● grails-app/conf/hibernate --> optional hibernate config ● grails-app/conf/spring --> optional spring config ● grails-app/controllers/ --> location of controller artifacts ● grails-app/domain/ --> location of domain classes ● grails-app/i18n/ --> location of message bundles for i18n ● grails-app/services/ --> location of services ● grails-app/taglib/ --> location of tag libraries ● grails-app/utils/ --> location of grails specific utility classes ● grails-app/views/ --> location of views ● grails-app/views/layouts --> location of layouts ● lib/ --> jar files not available via installed plugins ● scripts/ --> scripts ● src/groovy --> optional; location for Groovy source files (of types other than those in grails-app/*) ● src/java --> optional; location for Java source files ● test/ --> test classes ● web-app/ --> css, images, etc, etc, etc.
  • 9. Step 2: grails create-domain-class Person ● Created file grails-app/domain/addressbook/Person.groovy Created file test/unit/addressbook/PersonTests.groovy ● ● class Person { ● String firstName ● String lastName ● Date dateOfBirth ● Integer age ● ● static constraints = { ● firstName(nullable:true, maxSize:60) ● lastName(nullable:true, maxSize:30) ● dateOfBirth(nullable:true, maxSize:10) ● age(nullable:true) ● } ● }
  • 10. Step 3: grails generate-all Person ● Finished generation for domain class addressbook.Person
  • 11. Step 4: grails run-app Server running. Browse to http://localhost:8080/addressbook
  • 12. Step 4: grails run-app
  • 13. Step 4: grails run-app
  • 14. My Open Source Grails Plugins ● I contributed 15 Grails plugins out of 826 (13 Aug 2012), including: ● Grails Activiti Plugin ● http://code.google.com/p/grails-activiti-plugin/ ● Grails Form Builder Plugin ● http://code.google.com/p/grails-form-builder-plugin/ ● JQuery Validation UI Plugin ● http://grails.org/plugin/jquery-validation-ui ● Mahout Recommender Plugin ● https://github.com/limcheekin/mahout-recommender ● Find out more at http://goo.gl/VPVrd
  • 15. Q&A