SlideShare a Scribd company logo
Women Techmakers: Minneapolis
Minneapolis, MN
March 22, 2014
 Prerequisites
 Java jdk
 try ‘java –version’ to see if it’s already installed
 http://www.grails.org/Installation
 To Install Groovy and Grails:
 Gvmtool.net
 curl –s get.gvmtool.net | bash
 gvm install groovy
 gvm install grails
 gvm use grails 2.3.4
 An organization for the support of women in
the Gr8 stack community
 Goals:
 Education
 Networking
 Professional Development
 Contact Us
 @Gr8Ladies on twitter
 Gr8Ladies.org
 LinkedIn, Facebook search Gr8Ladies
 Contribute to our website via GitHub
 Groovy – the language
 Grails – MVC framework
 Gradle –build automation tool
 Used to build Android Apps
 Griffon – desktop app framework
 Spock – testing framework
 Many other minor frameworks and
development tools
Image via: http://blogs.vitoria-gasteiz.org/ti/2010/05/31/full-stack/
 Dynamic compiled language
 Flexible
 optional typing
 default scope
 optional getters/setters
 Rapid Development
 Integrates with existing JAVA libraries and
infrastructure
 #groovylang
 In Java,
 In Groovy,
 Elvis Operator ?:
 In PHP:
 In Groovy:
 Ranges
 A collection of numbers defined by boundaries
 Spread dot
 Applies a function to every element of a collection
and returns the result
 Null safe
 user?.chapter?.name?.toUpperCase()
 will return null if user or chapter is null and will not
return an error
 Groovy Truth
 Null, empty string, empty set, and 0 are all false!
Image via: http://blogs.vitoria-gasteiz.org/ti/2010/05/31/full-stack/
 MVC framework
 similar to Symphony in PHP, Django in Python, or
Ruby on Rails
 Convention over configuration
 #grailsfw
image from: http://www.mathiasbosman.be/wp-
content/uploads/2014/02/mvc_role_diagram.png
 Domain Classes
 Grails Object Relationship
Mapping(GORM)
 Uses Hibernate
 Class names map to tables
 Field names map to
columns
 Dynamic finders
 User.findAllByGenderAnd
ChapterIsNotNull(‘F’)
 Events
 beforeInsert, afterUpdate,
beforeDelete
 Alternatives
 Mongo and Redis
 Mapped to urls by
name
 /user/list
UserController.list()
 Url Parameters map
to controller
 /user/show/id
UserController.sho
w(id)
 GSP (Groovy Server
Page)
 Directory structure by
convention
 UserController.list()
renders
/views/user/list.gsp
 Special tags for forms,
links, looping and other
tasks
 Reference model data
by ${model.attribute}
 Lots of Options for writing tests
 Spock (default)
 JUnit
 Geb
• www.gebish.org
• http://docs.spockframework.org/en/spock-0.7-groovy-
2.0/
• For Grails, in BuildConfig.groovy:
dependencies {
test "org.seleniumhq.selenium:selenium-support:2.40.0"
test "org.seleniumhq.selenium:selenium-firefox-driver:2.40.0"
test "org.gebish:geb-spock:0.9.2”
}
plugins {
test ":geb:0.9.2"
compile ":remote-control:1.4“ // For accessing the context of the
// grails app from tests
// Spock is already included in Grails 2.3.6
}
package com.allison.pages
import geb.Page
class EmployeeListPage extends Page {
// the link that is navigated to
// on the 'to' call
static url = "employee/list"
// the closure that is verified on
// the 'at' call
static at = {
pageTitle.text() == 'Employee List Page'
}
// The navigator objects
static content = {
pageTitle(wait: true) { $('h2.title') }
employeeLink(wait: true, to: EmployeeShowPage)
{ id ->
$('a.employeeLink', 'id': "${id}")
}
}
// It is good practice to wrap all the
// navigator objects in methods
boolean employeeLinkIsPresent(Long id) {
employeeLink(id).isDisplayed()
}
EmployeeShowPage clickEmployeeLink(Long id) {
employeeLink(id).click()
return browser.page
}
}
<html>
<head>
<title>Employee</title>
</head>
<body>
<h2 class="title">Employee List Page</h2>
<ul>
<li>
<a href="/gebDemo/employee/show/1" id="1”
class="employeeLink"> Alice LastName </a>
</li>
<li>
<a href="/gebDemo/employee/show/2" id="2”
class="employeeLink"> Bob LastName2 </a>
</li>
<li>
<a href="/gebDemo/employee/show/3" id="3”
class="employeeLink"> Charles LastName3 </a>
</li>
</ul>
</body>
</html>
package com.allison.functional
import com.allison.pages.EmployeeListPage
import com.allison.remote.EmployeeRemoteControl
import geb.spock.GebReportingSpec
class firstSpec extends GebReportingSpec {
EmployeeRemoteControl remote =
new EmployeeRemoteControl()
Long employeeId_1
Long employeeId_2
Long employeeId_3
def setup() {
EmployeeRemoteControl remote =
new EmployeeRemoteControl()
employeeId_1 =
remote.createEmployee('Alice', 'LastName')
employeeId_2 =
remote.createEmployee('Bob', 'LastName2')
employeeId_3 =
remote.createEmployee('Charles', 'LastName3')
}
CONTINUED 
def 'A descriptive name for the feature'() {
given: 'Setup stuff'
// Can be blank
when: 'The employee list page is navigated to'
EmployeeListPage employeeListPage =
to EmployeeListPage
then: 'The employee list page header is displayed'
assert at(EmployeeListPage) // All statements in a
// then-block are implicitly
// asserted
and: 'The employee is listed'
assert employeeListPage.employeeLinkIsPresent(
employeeId_1)
when: 'The employee is clicked'
employeeListPage.clickEmployeeLink(employeeId_1)
then: 'At the show employee page'
assert at(EmployeeShowPage)
}
def cleanup() {
remote.deleteEmployee(employeeId_1)
remote.deleteEmployee(employeeId_2)
remote.deleteEmployee(employeeId_3)
}
}
 GVM!
 Groovy enVironment Manager
 curl –s get.gvmtool.net | bash
 gvm install groovy
 gvm install grails
 Use grails 2.3.4
 Choose an IDE
 IntelliJ
 Eclipse
 Netbeans
 grails create-app appName
 auto generates app structure
 grails create-domain-class User
 Creates domain class and test file
 grails generate-all appName.User
 Auto generates views and controllers based on the
properties of the domain class
 Grails war
 Defaults to target/appName-0.1.war
 Deploy to JVM
 Example via Amazon ElasticBeanstalk
 Making Java Groovy – Ken Kousen
 Email jstrater@gr8ladies.org for coupon code
 Programming Grails – Bert Beckwith (O’reilly
animal book)
 Groovy In Action - Dierk Koenig with Andrew
Glover, Paul King, Guillaume Laforge and Jon
Skeet
 Many Tutorials available on grails.org
 Come to Groovy Users of Minnesota(GUM)
every second Tuesday of the month at Smart
Things
 Join Gr8Ladies for hack sessions and contribute
to the gr8ladies website on github
 Gr8Ladies.org or @Gr8Ladies on twitter

More Related Content

What's hot

React for Beginners
React for BeginnersReact for Beginners
React for Beginners
Derek Willian Stavis
 
React, Redux and es6/7
React, Redux and es6/7React, Redux and es6/7
React, Redux and es6/7
Dongho Cho
 
Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
Jared Erickson
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)
andrewnacin
 
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
Arpit Mohan
 
Groovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web ApplicationsGroovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web Applications
rohitnayak
 
Quicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of RustQuicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of Rust
Damien Castelltort
 
Nodejs do teste de unidade ao de integração
Nodejs  do teste de unidade ao de integraçãoNodejs  do teste de unidade ao de integração
Nodejs do teste de unidade ao de integração
Vinícius Pretto da Silva
 
Cueros%20 lazyload
Cueros%20 lazyloadCueros%20 lazyload
Cueros%20 lazyload
gerrytanjung
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
Hidenori Fujimura
 
Introduction to angular js
Introduction to angular jsIntroduction to angular js
Introduction to angular js
Marco Vito Moscaritolo
 
Plugin jQuery, Design Patterns
Plugin jQuery, Design PatternsPlugin jQuery, Design Patterns
Plugin jQuery, Design Patterns
Robert Casanova
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
Visual Engineering
 
Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6
Visual Engineering
 
Chromium Embedded Framework + Go at Brooklyn JS
Chromium Embedded Framework + Go at Brooklyn JSChromium Embedded Framework + Go at Brooklyn JS
Chromium Embedded Framework + Go at Brooklyn JS
quirkey
 
jQuery Plugin Creation
jQuery Plugin CreationjQuery Plugin Creation
jQuery Plugin Creation
benalman
 
Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。
Tsuyoshi Yamamoto
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
Nina Zakharenko
 
Rendering Maps in GeoScript
Rendering Maps in GeoScriptRendering Maps in GeoScript
Rendering Maps in GeoScript
Jared Erickson
 
Debugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo SorochanDebugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo Sorochan
Sphere Consulting Inc
 

What's hot (20)

React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
React, Redux and es6/7
React, Redux and es6/7React, Redux and es6/7
React, Redux and es6/7
 
Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)
 
Introduction to GIT
Introduction to GITIntroduction to GIT
Introduction to GIT
 
Groovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web ApplicationsGroovy & Grails: Scripting for Modern Web Applications
Groovy & Grails: Scripting for Modern Web Applications
 
Quicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of RustQuicli - From zero to a full CLI application in a few lines of Rust
Quicli - From zero to a full CLI application in a few lines of Rust
 
Nodejs do teste de unidade ao de integração
Nodejs  do teste de unidade ao de integraçãoNodejs  do teste de unidade ao de integração
Nodejs do teste de unidade ao de integração
 
Cueros%20 lazyload
Cueros%20 lazyloadCueros%20 lazyload
Cueros%20 lazyload
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
 
Introduction to angular js
Introduction to angular jsIntroduction to angular js
Introduction to angular js
 
Plugin jQuery, Design Patterns
Plugin jQuery, Design PatternsPlugin jQuery, Design Patterns
Plugin jQuery, Design Patterns
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6Workshop 10: ECMAScript 6
Workshop 10: ECMAScript 6
 
Chromium Embedded Framework + Go at Brooklyn JS
Chromium Embedded Framework + Go at Brooklyn JSChromium Embedded Framework + Go at Brooklyn JS
Chromium Embedded Framework + Go at Brooklyn JS
 
jQuery Plugin Creation
jQuery Plugin CreationjQuery Plugin Creation
jQuery Plugin Creation
 
Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。Grailsx@ロンドンへ行ってきた報告。
Grailsx@ロンドンへ行ってきた報告。
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
 
Rendering Maps in GeoScript
Rendering Maps in GeoScriptRendering Maps in GeoScript
Rendering Maps in GeoScript
 
Debugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo SorochanDebugging on Rails. Mykhaylo Sorochan
Debugging on Rails. Mykhaylo Sorochan
 

Viewers also liked

Van Poucke Rental Luxury line
Van Poucke Rental Luxury lineVan Poucke Rental Luxury line
Van Poucke Rental Luxury line
sitsol
 
10 Things to Do Today to be Happier Now!
10 Things to Do Today to be Happier Now!10 Things to Do Today to be Happier Now!
10 Things to Do Today to be Happier Now!
Kelly Loudermilk
 
Akron Zips Men’s Soccer
Akron Zips Men’s SoccerAkron Zips Men’s Soccer
Akron Zips Men’s Soccer
Marisa Null
 
Bezienswaardigheden
BezienswaardighedenBezienswaardigheden
BezienswaardighedenCindyI123
 
10 Things Women Think When Spring Starts
10 Things Women Think When Spring Starts10 Things Women Think When Spring Starts
10 Things Women Think When Spring Starts
Kelly Loudermilk
 

Viewers also liked (6)

Van Poucke Rental Luxury line
Van Poucke Rental Luxury lineVan Poucke Rental Luxury line
Van Poucke Rental Luxury line
 
10 Things to Do Today to be Happier Now!
10 Things to Do Today to be Happier Now!10 Things to Do Today to be Happier Now!
10 Things to Do Today to be Happier Now!
 
Akron Zips Men’s Soccer
Akron Zips Men’s SoccerAkron Zips Men’s Soccer
Akron Zips Men’s Soccer
 
Bezienswaardigheden
BezienswaardighedenBezienswaardigheden
Bezienswaardigheden
 
Etude
EtudeEtude
Etude
 
10 Things Women Think When Spring Starts
10 Things Women Think When Spring Starts10 Things Women Think When Spring Starts
10 Things Women Think When Spring Starts
 

Similar to Groovy Grails Gr8Ladies Women Techmakers: Minneapolis

Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Tsuyoshi Yamamoto
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with Netbeans
Carol McDonald
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorks
mwbrooks
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
David Padbury
 
Porting legacy apps to Griffon
Porting legacy apps to GriffonPorting legacy apps to Griffon
Porting legacy apps to Griffon
James Williams
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
Schalk Cronjé
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
Schalk Cronjé
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Spring boot
Spring boot Spring boot
Spring boot
Vinay Prajapati
 
Groovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsGroovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applications
IndicThreads
 
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 EnglishGrails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Sven Haiges
 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrap
donnfelker
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
Guillaume Laforge
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
Jonathan Felch
 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot World
Schalk Cronjé
 
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
Tsuyoshi Yamamoto
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
Alive Kuo
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
Kelly Robinson
 
GradleFX
GradleFXGradleFX
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
NexThoughts Technologies
 

Similar to Groovy Grails Gr8Ladies Women Techmakers: Minneapolis (20)

Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with Netbeans
 
BlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorksBlackBerry DevCon 2011 - PhoneGap and WebWorks
BlackBerry DevCon 2011 - PhoneGap and WebWorks
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Porting legacy apps to Griffon
Porting legacy apps to GriffonPorting legacy apps to Griffon
Porting legacy apps to Griffon
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Gradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 versionGradle in 45min - JBCN2-16 version
Gradle in 45min - JBCN2-16 version
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Spring boot
Spring boot Spring boot
Spring boot
 
Groovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applicationsGroovy - Grails as a modern scripting language for Web applications
Groovy - Grails as a modern scripting language for Web applications
 
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 EnglishGrails 0.3-SNAPSHOT Presentation WJAX 2006 English
Grails 0.3-SNAPSHOT Presentation WJAX 2006 English
 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrap
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Gradle in a Polyglot World
Gradle in a Polyglot WorldGradle in a Polyglot World
Gradle in a Polyglot World
 
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
名古屋SGGAE/J勉強会 Grails、Gaelykでハンズオン
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
 
GradleFX
GradleFXGradleFX
GradleFX
 
Config BuildConfig
Config BuildConfigConfig BuildConfig
Config BuildConfig
 

Recently uploaded

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
christinelarrosa
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
christinelarrosa
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 

Recently uploaded (20)

JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptxPRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
PRODUCT LISTING OPTIMIZATION PRESENTATION.pptx
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Christine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptxChristine's Supplier Sourcing Presentaion.pptx
Christine's Supplier Sourcing Presentaion.pptx
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 

Groovy Grails Gr8Ladies Women Techmakers: Minneapolis

  • 2.  Prerequisites  Java jdk  try ‘java –version’ to see if it’s already installed  http://www.grails.org/Installation  To Install Groovy and Grails:  Gvmtool.net  curl –s get.gvmtool.net | bash  gvm install groovy  gvm install grails  gvm use grails 2.3.4
  • 3.  An organization for the support of women in the Gr8 stack community  Goals:  Education  Networking  Professional Development  Contact Us  @Gr8Ladies on twitter  Gr8Ladies.org  LinkedIn, Facebook search Gr8Ladies  Contribute to our website via GitHub
  • 4.  Groovy – the language  Grails – MVC framework  Gradle –build automation tool  Used to build Android Apps  Griffon – desktop app framework  Spock – testing framework  Many other minor frameworks and development tools
  • 6.  Dynamic compiled language  Flexible  optional typing  default scope  optional getters/setters  Rapid Development  Integrates with existing JAVA libraries and infrastructure  #groovylang
  • 7.  In Java,  In Groovy,
  • 8.  Elvis Operator ?:  In PHP:  In Groovy:
  • 9.  Ranges  A collection of numbers defined by boundaries  Spread dot  Applies a function to every element of a collection and returns the result
  • 10.  Null safe  user?.chapter?.name?.toUpperCase()  will return null if user or chapter is null and will not return an error
  • 11.  Groovy Truth  Null, empty string, empty set, and 0 are all false!
  • 13.  MVC framework  similar to Symphony in PHP, Django in Python, or Ruby on Rails  Convention over configuration  #grailsfw
  • 15.
  • 16.  Domain Classes  Grails Object Relationship Mapping(GORM)  Uses Hibernate  Class names map to tables  Field names map to columns  Dynamic finders  User.findAllByGenderAnd ChapterIsNotNull(‘F’)  Events  beforeInsert, afterUpdate, beforeDelete  Alternatives  Mongo and Redis
  • 17.  Mapped to urls by name  /user/list UserController.list()  Url Parameters map to controller  /user/show/id UserController.sho w(id)
  • 18.  GSP (Groovy Server Page)  Directory structure by convention  UserController.list() renders /views/user/list.gsp  Special tags for forms, links, looping and other tasks  Reference model data by ${model.attribute}
  • 19.  Lots of Options for writing tests  Spock (default)  JUnit  Geb
  • 20. • www.gebish.org • http://docs.spockframework.org/en/spock-0.7-groovy- 2.0/ • For Grails, in BuildConfig.groovy: dependencies { test "org.seleniumhq.selenium:selenium-support:2.40.0" test "org.seleniumhq.selenium:selenium-firefox-driver:2.40.0" test "org.gebish:geb-spock:0.9.2” } plugins { test ":geb:0.9.2" compile ":remote-control:1.4“ // For accessing the context of the // grails app from tests // Spock is already included in Grails 2.3.6 }
  • 21. package com.allison.pages import geb.Page class EmployeeListPage extends Page { // the link that is navigated to // on the 'to' call static url = "employee/list" // the closure that is verified on // the 'at' call static at = { pageTitle.text() == 'Employee List Page' } // The navigator objects static content = { pageTitle(wait: true) { $('h2.title') } employeeLink(wait: true, to: EmployeeShowPage) { id -> $('a.employeeLink', 'id': "${id}") } } // It is good practice to wrap all the // navigator objects in methods boolean employeeLinkIsPresent(Long id) { employeeLink(id).isDisplayed() } EmployeeShowPage clickEmployeeLink(Long id) { employeeLink(id).click() return browser.page } } <html> <head> <title>Employee</title> </head> <body> <h2 class="title">Employee List Page</h2> <ul> <li> <a href="/gebDemo/employee/show/1" id="1” class="employeeLink"> Alice LastName </a> </li> <li> <a href="/gebDemo/employee/show/2" id="2” class="employeeLink"> Bob LastName2 </a> </li> <li> <a href="/gebDemo/employee/show/3" id="3” class="employeeLink"> Charles LastName3 </a> </li> </ul> </body> </html>
  • 22. package com.allison.functional import com.allison.pages.EmployeeListPage import com.allison.remote.EmployeeRemoteControl import geb.spock.GebReportingSpec class firstSpec extends GebReportingSpec { EmployeeRemoteControl remote = new EmployeeRemoteControl() Long employeeId_1 Long employeeId_2 Long employeeId_3 def setup() { EmployeeRemoteControl remote = new EmployeeRemoteControl() employeeId_1 = remote.createEmployee('Alice', 'LastName') employeeId_2 = remote.createEmployee('Bob', 'LastName2') employeeId_3 = remote.createEmployee('Charles', 'LastName3') } CONTINUED  def 'A descriptive name for the feature'() { given: 'Setup stuff' // Can be blank when: 'The employee list page is navigated to' EmployeeListPage employeeListPage = to EmployeeListPage then: 'The employee list page header is displayed' assert at(EmployeeListPage) // All statements in a // then-block are implicitly // asserted and: 'The employee is listed' assert employeeListPage.employeeLinkIsPresent( employeeId_1) when: 'The employee is clicked' employeeListPage.clickEmployeeLink(employeeId_1) then: 'At the show employee page' assert at(EmployeeShowPage) } def cleanup() { remote.deleteEmployee(employeeId_1) remote.deleteEmployee(employeeId_2) remote.deleteEmployee(employeeId_3) } }
  • 23.  GVM!  Groovy enVironment Manager  curl –s get.gvmtool.net | bash  gvm install groovy  gvm install grails  Use grails 2.3.4  Choose an IDE  IntelliJ  Eclipse  Netbeans
  • 24.  grails create-app appName  auto generates app structure  grails create-domain-class User  Creates domain class and test file  grails generate-all appName.User  Auto generates views and controllers based on the properties of the domain class
  • 25.  Grails war  Defaults to target/appName-0.1.war  Deploy to JVM  Example via Amazon ElasticBeanstalk
  • 26.  Making Java Groovy – Ken Kousen  Email jstrater@gr8ladies.org for coupon code  Programming Grails – Bert Beckwith (O’reilly animal book)  Groovy In Action - Dierk Koenig with Andrew Glover, Paul King, Guillaume Laforge and Jon Skeet  Many Tutorials available on grails.org
  • 27.  Come to Groovy Users of Minnesota(GUM) every second Tuesday of the month at Smart Things  Join Gr8Ladies for hack sessions and contribute to the gr8ladies website on github  Gr8Ladies.org or @Gr8Ladies on twitter

Editor's Notes

  1. We use Geb Page Objects to model the html of the web page. A page object provides an interface to interact with the web page.
  2. Spock is the test runner. It has support for setup and cleanup functions that are like Junit @Before and @After. They enforce a given/when/then syntax to organize your tests.