philip stehlik at techtalks.ph - intro to groovy and grails
TRANSCRIPT
INTRODUCTION TO GROOVY AND GRAILS AT TAULIA 2012-07-11 for TechTalks.ph Philip Stehlik
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
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, ...
How to interact with our systems
• Browser • REST • SOAP • XMLRPC • File exchange (FTP(S), AS2, SSH)
• Lots of data munching and transformation
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
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
Groovy
• Started development in 2003 • Groovy 1.0 January 2, 2007 • Dynamic language for the Java Virtual
Machine
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'
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)
Java for(int x = 0; x < 20; x++){ System.out.println("counter is: " + x ); }
Groovy 20.times { println "counter is: ${it}" }
Running .groovy files
• from command line groovy [file name] • compile and distribute as JAR/WAR • groovyConsole • online http://groovyconsole.appspot.com/ • groovy sh
Code
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)
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 ...
Code
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 ...
More?
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
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
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
Thanks!
Say hi when you are in San Francisco! [email protected] @pstehlik http://pstehlik.com