![Page 1: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/1.jpg)
INTRODUCTION TO GROOVY AND GRAILS AT TAULIA 2012-07-11 for TechTalks.ph Philip Stehlik
![Page 2: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/2.jpg)
About
• Entrepreneur living in San Francisco • Co-Founder and CTO Taulia • Coding since teenage years (PHP, Objective-
C, ABAP, JS, Java, Groovy) • Taulia serving Fortune 2000 companies with
financial software (SaaS + Add-On for SAP) • Engineering team of ~20 people • Almost everything in Groovy
![Page 3: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/3.jpg)
Taulia's tech stack
• Groovy and Grails from day 1 (Grails 1.0) • Completely in the cloud • Integrating with many outside systems • Partners (e-invoicing, orders, payment
details, ...) • Web Services • Interfacing with 'Legacy' technologies • Gradle, Spring, Hibernate, Jersey, Maven, ...
![Page 4: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/4.jpg)
How to interact with our systems
• Browser • REST • SOAP • XMLRPC • File exchange (FTP(S), AS2, SSH)
• Lots of data munching and transformation
![Page 5: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/5.jpg)
Kinds of data
• Invoices, Payment history, Orders • Vendor data – address, social security, tax ID • Messages, logins, users • Logs • Complete history of 2 yrs of our customers
upon project launch
![Page 6: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/6.jpg)
![Page 7: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/7.jpg)
Why we like Groovy
• Simple, nice language • Dynamic features (for builders, testing, ...) • Closures • Tight and easy integration possibilities with
Java • Open source (Apache 2 license) • Grails
![Page 8: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/8.jpg)
Groovy
• Started development in 2003 • Groovy 1.0 January 2, 2007 • Dynamic language for the Java Virtual
Machine
![Page 9: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/9.jpg)
Groovy
• Almost all valid Java code is valid Groovy code
• Mostly dynamic typing (static typing since 2.0 in core)
• Closures • DSLs and builders • Object oriented • Also 'scripting language'
![Page 10: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/10.jpg)
System.out.println("Hello, World!");
println 'Hello, World!'
def name = 'Luke'
println "$name, I am your father."
String yodaSays = """${name}, your
father he is."""
assert 0.5 == 1/2
def printSize(obj) {
print obj?.size()
}
def letters = ['a', 'b', 'c']
letters.each { letter ->
assert letter < 'd'
}
// optional semicolon // System.out, brackets, // main(), class defn // dynamic typing // GString // multi-line string // with static typing // BigDecimal equals() // optional duck typing // safe dereferencing // native list syntax // closure support // overload '<' on String // or: for (pet in pets)
![Page 11: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/11.jpg)
Java for(int x = 0; x < 20; x++){ System.out.println("counter is: " + x ); }
Groovy 20.times { println "counter is: ${it}" }
![Page 12: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/12.jpg)
Running .groovy files
• from command line groovy [file name] • compile and distribute as JAR/WAR • groovyConsole • online http://groovyconsole.appspot.com/ • groovy sh
![Page 13: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/13.jpg)
Code
![Page 14: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/14.jpg)
![Page 15: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/15.jpg)
Grails
• High productivity web development framework
• First version in 2006 (1.0 in 2008) • Version 2.1 recently released • Open source (Apache 2 license) • Supported by SpringSource (VMware)
![Page 16: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/16.jpg)
Grails
• Spring, Hibernate, Groovy • MVC • GroovyServerPages • Convention over configuration • Plugin system
o MongoDB, Redis o Jquery, Mootols, Bootstrap, BlueprintCSS o Quartz, Apache Shiro, GoogleAppEngine o ...
![Page 17: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/17.jpg)
Code
![Page 18: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/18.jpg)
Additional info
• IDE o IntelliJ o STS (SpringSource Tool Suite) o Eclipse plugin
• Other prominent users o Netflix (Just released Asgard) o Sky.com o wired.com o ...
![Page 19: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/19.jpg)
More?
![Page 20: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/20.jpg)
Taulia Architecture
• Everything running on AWS • Multiple zones and regions • Tomcat • Apache • HAProxy • MySQL, MongoDB, S3 • All traffic and business data encrypted with at
least AES256 • Multiple Grails apps, Servlets, jobs
![Page 21: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/21.jpg)
Idea to Deployment
• One-Pager • Product team:
o Product Manager o Engineer o Quality Engineer
Meeting at least weekly with everybody involved to gauge progress.
• Paper prototyping, interviews, refining • Everybody involved from the beginning
![Page 22: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails](https://reader031.vdocuments.net/reader031/viewer/2022020207/554dbd66b4c905bd488b4a4d/html5/thumbnails/22.jpg)
Idea to Deployment #2
• Developer codes locally • All tests on each commit (Jenkins) • Auto deploys to integration environment (also
publicly accessible for feedback and demos) • QE and product feedback • Iterate • Two week sprints – deploy to public QA and
PRD • Using sleeping features