Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Pourquoi vous devriez utiliser Groovy
Search
Cédric Champeau
November 25, 2014
Programming
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Pourquoi vous devriez utiliser Groovy
Talk donné au FinistJUG.
Cédric Champeau
November 25, 2014
More Decks by Cédric Champeau
See All by Cédric Champeau
Integrating Python and Java easily using (Micronaut) GraalPy
melix
0
110
JSol'Ex : traitement d'images solaires en Java
melix
0
290
JSol'Ex : solar image processing in Java
melix
0
930
Ecrire un microservice Java natif avec Micronaut et GraalVM
melix
1
280
Micronaut Test Resources
melix
1
340
Micronaut Test Resources
melix
1
500
AlpesJUG: Micronaut Test Resources
melix
0
180
Micronaut_Test_Resources.pdf
melix
0
280
Consommation électrique du foyer
melix
0
330
Other Decks in Programming
See All in Programming
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Agents on Rails - Rails at Scale 2026
irinanazarova
0
530
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
370
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
180
ジョジョの世界をXRで再現する
mofurune
0
150
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
400
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.3k
ChromeでローカルLLM
ryu1013
0
110
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
100
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.8k
Skip the Path - Find Your Career Trail
mkilby
1
250
Become a Pro
speakerdeck
PRO
31
6.3k
GitHub's CSS Performance
jonrohan
1033
470k
Designing for humans not robots
tammielis
254
26k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
940
sira's awesome portfolio website redesign presentation
elsirapls
0
450
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
For a Future-Friendly Web
brad_frost
184
10k
Chasing Engaging Ingredients in Design
codingconduct
0
360
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
630
Transcript
N'ayez pas peur de faire du @CedricChampeau
Made in Nantes
Scripting
log.message "Releasing Groovy $version with user: $user" def desc =
"Release of $version" def date = new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ") def remoteCall = { String url, List params, Closure onFailure -> def p = ['curl', "-m", "3600", "-u", "$user:$key", *params, url].execute() int code = p.waitFor() def resp = p.text log.message "${resp}" if (code!=0 || resp.toLowerCase().contains('error') ) { onFailure(code) System.exit(code) } }
DSLs
remoteSession { scp { from { localDir "$buildDir/application " }
into { remoteDir '/usr/local/myapp' } timeout 10.minutes } }
Java friendly
@Immutable @ToString class Person { String name int age String
greet(String them) { "Hello $them, my name is $name" } }
Dynamic
@ToString class Person { String name int age } def
storage = [new Person(name:'Cédric', age:35), new Person(name:'Hugues', age:44)] Person.metaClass.static.methodMissing = { String name, args -> if (name.startsWith('findBy')) { String prop = (name - 'findBy').toLowerCase() storage.findAll { it."$prop" == args[0]} } } println Person.findByAge(35)
Static
@ToString class Person { String name int age } @CompileStatic
void erreurDeCompil() { println Person.findByAge(35) }
Functional
new URL('http://beta.groovy-lang.org').text .split(' ') .findAll { it == 'Groovy' }
.size()
Microservices?
@Grab('com.h2database:h2:1.3.179') import grails.persistence.* @Entity @Resource(uri='books') class Book { String title
}
Builds
apply plugin: 'groovy' repositories { jcenter() } dependencies { compile
'org.codehaus.groovy:groovy:2.3.4-beta-3' }
Android
notify(NOTIFICATION_ID) { smallIcon = R.drawable.ic_action_alarms largeIcon = cachedBitmap contentTitle =
'Time left' contentText = "$timeLeft (Elapsed: ${rounded}%)" contentIntent = pendingActivityIntent(0, intent(WearPresentationActivity), FLAG_UPDATE_CURRENT) ongoing = true style = bigTextStyle { bigText """Time left for your presentation: $timeLeft Elapsed time: ${rounded}%) """ } }
Templating
layout 'layouts/main.groovy', true, pageTitle: 'The Groovy programming language - Mailing-lists',
mainContent: contents { div(id: 'content', class: 'page-1') { div(class: 'row') { div(class: 'row-fluid') { div(class: 'col-lg-3') { include template: 'includes/community-navbar.groovy' } div(class: 'col-lg-8 col-lg-pull-0') { include template: 'includes/contribute-button.groovy' h1 { i(class: 'fa fa-envelope-o') {} yield ' Mailing-lists' } ...
Et tant d'autres...
None
Merci ! @CedricChampeau