philip stehlik at techtalks.ph - intro to groovy and grails

23
INTRODUCTION TO GROOVY AND GRAILS AT TAULIA 2012-07-11 for TechTalks.ph Philip Stehlik

Upload: philip-stehlik

Post on 09-May-2015

715 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails

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

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

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

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

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
Page 7: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails

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

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

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

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

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

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

Code

Page 14: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails
Page 15: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails

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

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

Code

Page 18: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails

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

More?

Page 20: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails

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

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

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

Page 23: Philip Stehlik at TechTalks.ph - Intro to Groovy and Grails

Thanks!

Say hi when you are in San Francisco! [email protected] @pstehlik http://pstehlik.com