SlideShare una empresa de Scribd logo
1 de 78
Cool Web Apps with Grails, Groovy and Next-Gen Scripting Languages William Grosso Twofish
Abstract ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Actual Talk ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Who Am I?
Opinionated Talk ,[object Object],[object Object],[object Object],[object Object],[object Object],And these are my opinions, not necessarily Twofish’s
This all started in July ,[object Object],[object Object],[object Object],[object Object]
Up and running for >3 months without any attention from me
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
In 2003 …  ,[object Object],[object Object],[object Object],[object Object]
That Talk Began With …. ,[object Object],[object Object],[object Object],[object Object]
My 2003 Big Bold Claim ,[object Object],[object Object],[object Object]
Supporting Communities ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
I Was Right ,[object Object],[object Object],[object Object]
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
But I Wasn’t Completely Right JVM Platform Libraries and  Application Frameworks Your App / Your Web App Your Libraries Your Prototypes Down here, Java, super clear semantics, WORA etcetera win Hmm. Community properties probably only matter for largish things that you share or keep and reuse for a long time. Maybe we can do better than Java?
Lots of people having similar thoughts. The JVM is robust enough, and the platform is robust enough, and … that people are starting to seriously layer languages on top.
Short list of “interesting” languages: Jython JRuby Scala Groovy Kawa Clojure PHP NetRexx (??)
Completely a sidenote: If you’re curious about programming language design, this is the single best  site on the web
Closures have been THE hot topic in commercial language design
Odersky’s claim: closures + first class  containers + super strong typing are the bees knees
Complexity is bad. Java is near the edge of the cliff. 4.5M PDF and a Tiny Thumbnail? For Generics? Ruby has a similar problem (more later)
Desiderata for the Tiers JVM Platform Libraries and  Application Frameworks Your App Your Libraries Your Prototypes Strong typing Absolutely clear semantics Minimal evolution of language None of the other stuff is necessary Looks like Java Clear, readable code Non-verbose language Complete integration with Java First class containers Closures Great XML support  Rapid Prototyping  (REPL) Metaobject Protocol
Only Groovy Makes the Short List ,[object Object],[object Object],[object Object],[object Object],[object Object]
 
Looks Like Java Go read the code examples It’s easy
Let’s Look at Concurrency Not Java def? 1 .. 8  sleep 30 But … it’s close
Complete Integration with Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
import groovy.swing.*; import java.awt.*; import javax.swing.*; class Model extends Observable { static CURRENCY = ["USD", "EURO", "YEN"] private Map rates = new HashMap() private long value void initialize(initialRates) { (0..CURRENCY.size() - 1).each { setRate(CURRENCY[it], initialRates[it]) } } // setting rate for currency void setRate(currency, f) { rates.put(currency, f); setChanged(); notifyObservers(currency); } // setting new value for currency void setValue(currency, double newValue) { value = Math.round(newValue / rates[currency]); setChanged(); notifyObservers(null); } // getter for value for particular currency def getValue(currency) { value * rates[currency] } } class RateView extends JTextField implements Observer { private Model model; private currency; public void setModel(Model model) { this.model?.removeObserver(this) this.model = model model.addObserver(this) } public void update(Observable o, Object currency) { if (this.currency == currency) text = String.format("%15.2f", model.rates[currency]) } } class ValueView extends JTextField implements Observer { private Model model private currency public void setModel(Model model) { this.model?.removeObserver(this) this.model = model model.addObserver(this) } public void update(Observable o, Object currency) { if (currency == null || this.currency == currency) text = String.format("%15.2f", model.getValue(this.currency)); } }
swing = new SwingBuilder() model = new Model() frame = swing.frame(title: "Groovy SwingBuilder MVC Demo", layout: new GridLayout(4, 3), size: [300, 150], defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE) { label("currency") label("rate") label("value") for (c in Model.CURRENCY) { label(c) widget(new RateView(), model: model, currency: c, action: swing.action(closure: { event -> event.source.model.setRate(event.source.currency, event.source.text.toDouble()); })) widget(new ValueView(), model: model, currency: c, action: swing.action(closure: {event -> event.source.model.setValue(event.source.currency, event.source.text.toDouble()); })) } } frame.show() model.initialize([1.0, 0.83, 0.56]);
 
 
First Class Containers ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
weekMap = [ "Su" : "Sunday", "Mo" : "Monday", "Tu" : "Tuesday", "We" : "Wednesday", "Th" : "Thursday", "Fr" : "Friday", "Sa" : "Saturday" ] weekMap.each() { key, value -> println "${key} == ${value}" }
Gafter’s Def’n of Closure ,[object Object],[object Object],[object Object]
In Practice ,[object Object],[object Object],[object Object],def foo = { a,b,c -> bunch of code} foo(“e”, “f”, “g”)
Inner Classes are Close! ,[object Object],[object Object],[object Object],[object Object]
Don’t believe me?  Neal likes Java  a LOT more than I do
XML Support ,[object Object],def CAR_RECORDS = ''' <records> <car name='HSV Maloo' make='Holden' year='2006'> <country>Australia</country> <record type='speed'>Production Pickup Truck with speed of 271kph</record> </car> <car name='P50' make='Peel' year='1962'> <country>Isle of Man</country> <record type='size'>Smallest Street-Legal Car at 99cm wide and 59 kg in weight</record> </car> <car name='Royale' make='Bugatti' year='1931'> <country>France</country> <record type='price'>Most Valuable Car at $15 million</record> </car> </records> ''' def records = new XmlSlurper().parseText(CAR_RECORDS) def allRecords = records.car println allRecords.size() println records.car[0].name() println records.car[0].@year println records.car[0].country
XML Support II ,[object Object],[object Object]
Rapid Prototyping: Scripts, Shell and Console ,[object Object],[object Object],[object Object],[object Object],[object Object]
Metaobject Protocol ,[object Object],[object Object]
MetaObject Protocols: The Point ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],OPINIONS VARY AS TO WHETHER ALLOWING THIS  SORT OF THING IS A GOOD  IDEA!!!!
Chris will talk more about GORM later on
Builders ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What’s Martin Fowler been doing since the refactoring book anyway?
 
How to Build a Builder ,[object Object],[object Object],[object Object],protected abstract Object createNode(Object name) protected abstract Object createNode(Object name, Map attributes) protected abstract Object createNode(Object name, Map attributes, Object value) protected abstract Object createNode(Object name, Object value)  protected abstract void setParent(Object parent, Object child)  Groovy is designed to work with Java.
MarkupBuilder import groovy.xml.MarkupBuilder  def writer = new StringWriter()  def xml = new MarkupBuilder(writer) xml.records() {  car(name:'HSV Maloo', make:'Holden', year:2006) {  country('Australia')  record(type:'speed', 'Production Pickup Truck with speed of 271kph')  }  car(name:'P50', make:'Peel', year:1962) {  country('Isle of Man')  record(type:'size', 'Smallest Street-Legal Car at 99cm wide and 59 kg in weight')  }  car(name:'Royale', make:'Bugatti', year:1931) {  country('France')  record(type:'price', 'Most Valuable Car at $15 million')  }  }  println writer.toString()
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Rails as a Thunderbolt ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Rails guys invented the “movie to demo the framework” idea and their movies are still WOW OH WOW GOOD
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],PHP: 8 Java: 7 .NET: 2 Perl: 2 Ruby: 1
In 4 years, Rails has made very impressive strides. Market leader in the “early stage startup” category.
Issues with Ruby ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Backwards compatibility is not a huge priority
Backwards compatibility is not a huge priority
This is scary
Of course, Java is mostly developed by Sun ….
This is from a Ruby guy who doesn’t like JRuby very much …
Issues with Rails ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Grails is “Groovy on Rails” ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pieces / Parts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],More on these later
GORM ,[object Object]
Plugins and Extensability ,[object Object],[object Object]
SWAG Estimate: About ¾ of plugins are mentioned here (BIRT, for example, is not)
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Twofish Model TFEL TFEL DB TFEL DB ,[object Object],[object Object],[object Object],[object Object],[object Object],PS ,[object Object],[object Object],[object Object],[object Object]
<<IntelliJ>>
Annoyances (Love Mashup) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Plugins (Love Mashup) ,[object Object],[object Object],[object Object]
Annoyances (Twofish) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Plugins (Twofish) ,[object Object],[object Object],[object Object]
Additional Reading
This is a great series of articles. Whenever anyone tells you a technology is going to be big, ask yourself: WWTT?
 
 

Más contenido relacionado

La actualidad más candente

25 php interview questions – codementor
25 php interview questions – codementor25 php interview questions – codementor
25 php interview questions – codementorArc & Codementor
 
Az ve Öz Kotlin - Beyza KOYULMUS
 Az ve Öz Kotlin - Beyza KOYULMUS Az ve Öz Kotlin - Beyza KOYULMUS
Az ve Öz Kotlin - Beyza KOYULMUSBeyzaKOYULMUS
 
Type Script Conceitos de ts para projetos front-end React - por ruben marcus
Type Script   Conceitos de ts para projetos front-end React - por ruben marcusType Script   Conceitos de ts para projetos front-end React - por ruben marcus
Type Script Conceitos de ts para projetos front-end React - por ruben marcusRuben Marcus Luz Paschoarelli
 
Advanced PHP: Design Patterns - Dennis-Jan Broerse
Advanced PHP: Design Patterns - Dennis-Jan BroerseAdvanced PHP: Design Patterns - Dennis-Jan Broerse
Advanced PHP: Design Patterns - Dennis-Jan Broersedpc
 
Feelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive MetaprogrammingFeelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive MetaprogrammingMatt Stine
 
Grooming with Groovy
Grooming with GroovyGrooming with Groovy
Grooming with GroovyDhaval Dalal
 
Common design patterns in php
Common design patterns in phpCommon design patterns in php
Common design patterns in phpDavid Stockton
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi pptmark-asoi
 
WordCamp US: Clean Code
WordCamp US: Clean CodeWordCamp US: Clean Code
WordCamp US: Clean Codemtoppa
 
PHP Doesn't Suck
PHP Doesn't SuckPHP Doesn't Suck
PHP Doesn't SuckJohn Hobbs
 
Kotlin vs Java • Bapusaheb Patil • TechieAid Talk
Kotlin vs Java • Bapusaheb Patil • TechieAid TalkKotlin vs Java • Bapusaheb Patil • TechieAid Talk
Kotlin vs Java • Bapusaheb Patil • TechieAid TalkBapusaheb Patil
 
What is the best programming language for beginner?
What is the best programming language for beginner?What is the best programming language for beginner?
What is the best programming language for beginner?Designveloper
 
Introjs10.5.17SD
Introjs10.5.17SDIntrojs10.5.17SD
Introjs10.5.17SDThinkful
 

La actualidad más candente (19)

25 php interview questions – codementor
25 php interview questions – codementor25 php interview questions – codementor
25 php interview questions – codementor
 
Introduction to Java Scripting
Introduction to Java ScriptingIntroduction to Java Scripting
Introduction to Java Scripting
 
Clojure
ClojureClojure
Clojure
 
Az ve Öz Kotlin - Beyza KOYULMUS
 Az ve Öz Kotlin - Beyza KOYULMUS Az ve Öz Kotlin - Beyza KOYULMUS
Az ve Öz Kotlin - Beyza KOYULMUS
 
Type Script Conceitos de ts para projetos front-end React - por ruben marcus
Type Script   Conceitos de ts para projetos front-end React - por ruben marcusType Script   Conceitos de ts para projetos front-end React - por ruben marcus
Type Script Conceitos de ts para projetos front-end React - por ruben marcus
 
Advanced PHP: Design Patterns - Dennis-Jan Broerse
Advanced PHP: Design Patterns - Dennis-Jan BroerseAdvanced PHP: Design Patterns - Dennis-Jan Broerse
Advanced PHP: Design Patterns - Dennis-Jan Broerse
 
A class action
A class actionA class action
A class action
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
 
Feelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive MetaprogrammingFeelin' Groovy: An Afternoon of Reflexive Metaprogramming
Feelin' Groovy: An Afternoon of Reflexive Metaprogramming
 
SLOID Share
SLOID ShareSLOID Share
SLOID Share
 
Grooming with Groovy
Grooming with GroovyGrooming with Groovy
Grooming with Groovy
 
Common design patterns in php
Common design patterns in phpCommon design patterns in php
Common design patterns in php
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
 
Plomino
Plomino Plomino
Plomino
 
WordCamp US: Clean Code
WordCamp US: Clean CodeWordCamp US: Clean Code
WordCamp US: Clean Code
 
PHP Doesn't Suck
PHP Doesn't SuckPHP Doesn't Suck
PHP Doesn't Suck
 
Kotlin vs Java • Bapusaheb Patil • TechieAid Talk
Kotlin vs Java • Bapusaheb Patil • TechieAid TalkKotlin vs Java • Bapusaheb Patil • TechieAid Talk
Kotlin vs Java • Bapusaheb Patil • TechieAid Talk
 
What is the best programming language for beginner?
What is the best programming language for beginner?What is the best programming language for beginner?
What is the best programming language for beginner?
 
Introjs10.5.17SD
Introjs10.5.17SDIntrojs10.5.17SD
Introjs10.5.17SD
 

Similar a Groovy And Grails

Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac xRemote Stacx
 
C# and java comparing programming languages
C# and java  comparing programming languagesC# and java  comparing programming languages
C# and java comparing programming languagesShishir Roy
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller ColumnsJonathan Fine
 
Javascript beginner-handbook
Javascript beginner-handbookJavascript beginner-handbook
Javascript beginner-handbookFaina Fridman
 
javascript-beginner-handbook.pdf
javascript-beginner-handbook.pdfjavascript-beginner-handbook.pdf
javascript-beginner-handbook.pdfRaviKumar76265
 
JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...
JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...
JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...Peter Hecker
 
Step by Step Guide on Essay Format in APA For Beginners
Step by Step Guide on Essay Format in APA For BeginnersStep by Step Guide on Essay Format in APA For Beginners
Step by Step Guide on Essay Format in APA For Beginnerscalltutors
 
Awesome free resources for learning javascript
Awesome free resources for learning javascriptAwesome free resources for learning javascript
Awesome free resources for learning javascriptDesignveloper
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?Orest Ivasiv
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworksYuri Visser
 
Six reasons to learn JavaScript
Six reasons to learn JavaScriptSix reasons to learn JavaScript
Six reasons to learn JavaScriptOtto Kekäläinen
 
Alvin gunawan aw_english
Alvin gunawan aw_englishAlvin gunawan aw_english
Alvin gunawan aw_englishAlvinGunawan6
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community SupportWilliam Grosso
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objectsvmadan89
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVMelliando dias
 
Glenn Vanderburg — Learning to love JavaScript
Glenn Vanderburg — Learning to love JavaScriptGlenn Vanderburg — Learning to love JavaScript
Glenn Vanderburg — Learning to love JavaScriptatr2006
 
Bledar Gjocaj - Java open source
Bledar Gjocaj - Java open sourceBledar Gjocaj - Java open source
Bledar Gjocaj - Java open sourceOpen Labs Albania
 

Similar a Groovy And Grails (20)

Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac x
 
C# and java comparing programming languages
C# and java  comparing programming languagesC# and java  comparing programming languages
C# and java comparing programming languages
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
Javascript beginner-handbook
Javascript beginner-handbookJavascript beginner-handbook
Javascript beginner-handbook
 
javascript-beginner-handbook.pdf
javascript-beginner-handbook.pdfjavascript-beginner-handbook.pdf
javascript-beginner-handbook.pdf
 
JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...
JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...
JavaScript nicht nur für Programmierer: Einblicke in die weltweit am meisten ...
 
Step by Step Guide on Essay Format in APA For Beginners
Step by Step Guide on Essay Format in APA For BeginnersStep by Step Guide on Essay Format in APA For Beginners
Step by Step Guide on Essay Format in APA For Beginners
 
Awesome free resources for learning javascript
Awesome free resources for learning javascriptAwesome free resources for learning javascript
Awesome free resources for learning javascript
 
Java for C++ programers
Java for C++ programersJava for C++ programers
Java for C++ programers
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
 
Lunch and learn as3_frameworks
Lunch and learn as3_frameworksLunch and learn as3_frameworks
Lunch and learn as3_frameworks
 
Six reasons to learn JavaScript
Six reasons to learn JavaScriptSix reasons to learn JavaScript
Six reasons to learn JavaScript
 
Alvin gunawan aw_english
Alvin gunawan aw_englishAlvin gunawan aw_english
Alvin gunawan aw_english
 
Java And Community Support
Java And Community SupportJava And Community Support
Java And Community Support
 
React js basics
React js basicsReact js basics
React js basics
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Dynamic Languages on the JVM
Dynamic Languages on the JVMDynamic Languages on the JVM
Dynamic Languages on the JVM
 
Glenn Vanderburg — Learning to love JavaScript
Glenn Vanderburg — Learning to love JavaScriptGlenn Vanderburg — Learning to love JavaScript
Glenn Vanderburg — Learning to love JavaScript
 
Bledar Gjocaj - Java open source
Bledar Gjocaj - Java open sourceBledar Gjocaj - Java open source
Bledar Gjocaj - Java open source
 

Más de William Grosso

Formal Aspects of Protege
Formal Aspects of ProtegeFormal Aspects of Protege
Formal Aspects of ProtegeWilliam Grosso
 
Knowing How People Are Playing Your Game Gives You the Winning Hand
Knowing How People Are Playing Your Game Gives You the Winning HandKnowing How People Are Playing Your Game Gives You the Winning Hand
Knowing How People Are Playing Your Game Gives You the Winning HandWilliam Grosso
 
Tales from the Platform Trade
Tales from the Platform TradeTales from the Platform Trade
Tales from the Platform TradeWilliam Grosso
 
Maxims for Multiplayer Games
Maxims for Multiplayer GamesMaxims for Multiplayer Games
Maxims for Multiplayer GamesWilliam Grosso
 
Crafting an Analytics Strategy
Crafting an Analytics StrategyCrafting an Analytics Strategy
Crafting an Analytics StrategyWilliam Grosso
 
UCSC Talk on Building Startups
UCSC Talk on Building StartupsUCSC Talk on Building Startups
UCSC Talk on Building StartupsWilliam Grosso
 
Scientific revenue unreasonable effectiveness of data
Scientific revenue unreasonable effectiveness of dataScientific revenue unreasonable effectiveness of data
Scientific revenue unreasonable effectiveness of dataWilliam Grosso
 
Taking Virtual Economies to the Next Level
Taking Virtual Economies to the Next LevelTaking Virtual Economies to the Next Level
Taking Virtual Economies to the Next LevelWilliam Grosso
 
Managing a Virtual Economy
Managing a Virtual EconomyManaging a Virtual Economy
Managing a Virtual EconomyWilliam Grosso
 
Applying Retail Strategies to Item Merchandising
Applying Retail Strategies to Item MerchandisingApplying Retail Strategies to Item Merchandising
Applying Retail Strategies to Item MerchandisingWilliam Grosso
 
Managing a Virtual Economy
Managing a Virtual EconomyManaging a Virtual Economy
Managing a Virtual EconomyWilliam Grosso
 
Virtual Worlds and Real Metrics:
Virtual Worlds and Real Metrics:Virtual Worlds and Real Metrics:
Virtual Worlds and Real Metrics:William Grosso
 
The Evolving Architecture
The Evolving ArchitectureThe Evolving Architecture
The Evolving ArchitectureWilliam Grosso
 

Más de William Grosso (15)

Slot Widgets
Slot WidgetsSlot Widgets
Slot Widgets
 
Formal Aspects of Protege
Formal Aspects of ProtegeFormal Aspects of Protege
Formal Aspects of Protege
 
Knowing How People Are Playing Your Game Gives You the Winning Hand
Knowing How People Are Playing Your Game Gives You the Winning HandKnowing How People Are Playing Your Game Gives You the Winning Hand
Knowing How People Are Playing Your Game Gives You the Winning Hand
 
Tales from the Platform Trade
Tales from the Platform TradeTales from the Platform Trade
Tales from the Platform Trade
 
Maxims for Multiplayer Games
Maxims for Multiplayer GamesMaxims for Multiplayer Games
Maxims for Multiplayer Games
 
Crafting an Analytics Strategy
Crafting an Analytics StrategyCrafting an Analytics Strategy
Crafting an Analytics Strategy
 
UCSC Talk on Building Startups
UCSC Talk on Building StartupsUCSC Talk on Building Startups
UCSC Talk on Building Startups
 
On the Startup Team
On the Startup TeamOn the Startup Team
On the Startup Team
 
Scientific revenue unreasonable effectiveness of data
Scientific revenue unreasonable effectiveness of dataScientific revenue unreasonable effectiveness of data
Scientific revenue unreasonable effectiveness of data
 
Taking Virtual Economies to the Next Level
Taking Virtual Economies to the Next LevelTaking Virtual Economies to the Next Level
Taking Virtual Economies to the Next Level
 
Managing a Virtual Economy
Managing a Virtual EconomyManaging a Virtual Economy
Managing a Virtual Economy
 
Applying Retail Strategies to Item Merchandising
Applying Retail Strategies to Item MerchandisingApplying Retail Strategies to Item Merchandising
Applying Retail Strategies to Item Merchandising
 
Managing a Virtual Economy
Managing a Virtual EconomyManaging a Virtual Economy
Managing a Virtual Economy
 
Virtual Worlds and Real Metrics:
Virtual Worlds and Real Metrics:Virtual Worlds and Real Metrics:
Virtual Worlds and Real Metrics:
 
The Evolving Architecture
The Evolving ArchitectureThe Evolving Architecture
The Evolving Architecture
 

Último

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Último (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Groovy And Grails

  • 1. Cool Web Apps with Grails, Groovy and Next-Gen Scripting Languages William Grosso Twofish
  • 2.
  • 3.
  • 4.
  • 5.
  • 7.
  • 8.
  • 9. Up and running for >3 months without any attention from me
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. But I Wasn’t Completely Right JVM Platform Libraries and Application Frameworks Your App / Your Web App Your Libraries Your Prototypes Down here, Java, super clear semantics, WORA etcetera win Hmm. Community properties probably only matter for largish things that you share or keep and reuse for a long time. Maybe we can do better than Java?
  • 18. Lots of people having similar thoughts. The JVM is robust enough, and the platform is robust enough, and … that people are starting to seriously layer languages on top.
  • 19. Short list of “interesting” languages: Jython JRuby Scala Groovy Kawa Clojure PHP NetRexx (??)
  • 20. Completely a sidenote: If you’re curious about programming language design, this is the single best site on the web
  • 21. Closures have been THE hot topic in commercial language design
  • 22. Odersky’s claim: closures + first class containers + super strong typing are the bees knees
  • 23. Complexity is bad. Java is near the edge of the cliff. 4.5M PDF and a Tiny Thumbnail? For Generics? Ruby has a similar problem (more later)
  • 24. Desiderata for the Tiers JVM Platform Libraries and Application Frameworks Your App Your Libraries Your Prototypes Strong typing Absolutely clear semantics Minimal evolution of language None of the other stuff is necessary Looks like Java Clear, readable code Non-verbose language Complete integration with Java First class containers Closures Great XML support Rapid Prototyping (REPL) Metaobject Protocol
  • 25.
  • 26.  
  • 27. Looks Like Java Go read the code examples It’s easy
  • 28. Let’s Look at Concurrency Not Java def? 1 .. 8 sleep 30 But … it’s close
  • 29.
  • 30. import groovy.swing.*; import java.awt.*; import javax.swing.*; class Model extends Observable { static CURRENCY = [&quot;USD&quot;, &quot;EURO&quot;, &quot;YEN&quot;] private Map rates = new HashMap() private long value void initialize(initialRates) { (0..CURRENCY.size() - 1).each { setRate(CURRENCY[it], initialRates[it]) } } // setting rate for currency void setRate(currency, f) { rates.put(currency, f); setChanged(); notifyObservers(currency); } // setting new value for currency void setValue(currency, double newValue) { value = Math.round(newValue / rates[currency]); setChanged(); notifyObservers(null); } // getter for value for particular currency def getValue(currency) { value * rates[currency] } } class RateView extends JTextField implements Observer { private Model model; private currency; public void setModel(Model model) { this.model?.removeObserver(this) this.model = model model.addObserver(this) } public void update(Observable o, Object currency) { if (this.currency == currency) text = String.format(&quot;%15.2f&quot;, model.rates[currency]) } } class ValueView extends JTextField implements Observer { private Model model private currency public void setModel(Model model) { this.model?.removeObserver(this) this.model = model model.addObserver(this) } public void update(Observable o, Object currency) { if (currency == null || this.currency == currency) text = String.format(&quot;%15.2f&quot;, model.getValue(this.currency)); } }
  • 31. swing = new SwingBuilder() model = new Model() frame = swing.frame(title: &quot;Groovy SwingBuilder MVC Demo&quot;, layout: new GridLayout(4, 3), size: [300, 150], defaultCloseOperation: WindowConstants.EXIT_ON_CLOSE) { label(&quot;currency&quot;) label(&quot;rate&quot;) label(&quot;value&quot;) for (c in Model.CURRENCY) { label(c) widget(new RateView(), model: model, currency: c, action: swing.action(closure: { event -> event.source.model.setRate(event.source.currency, event.source.text.toDouble()); })) widget(new ValueView(), model: model, currency: c, action: swing.action(closure: {event -> event.source.model.setValue(event.source.currency, event.source.text.toDouble()); })) } } frame.show() model.initialize([1.0, 0.83, 0.56]);
  • 32.  
  • 33.  
  • 34.
  • 35. weekMap = [ &quot;Su&quot; : &quot;Sunday&quot;, &quot;Mo&quot; : &quot;Monday&quot;, &quot;Tu&quot; : &quot;Tuesday&quot;, &quot;We&quot; : &quot;Wednesday&quot;, &quot;Th&quot; : &quot;Thursday&quot;, &quot;Fr&quot; : &quot;Friday&quot;, &quot;Sa&quot; : &quot;Saturday&quot; ] weekMap.each() { key, value -> println &quot;${key} == ${value}&quot; }
  • 36.
  • 37.
  • 38.
  • 39. Don’t believe me? Neal likes Java a LOT more than I do
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45. Chris will talk more about GORM later on
  • 46.
  • 47. What’s Martin Fowler been doing since the refactoring book anyway?
  • 48.  
  • 49.
  • 50. MarkupBuilder import groovy.xml.MarkupBuilder def writer = new StringWriter() def xml = new MarkupBuilder(writer) xml.records() { car(name:'HSV Maloo', make:'Holden', year:2006) { country('Australia') record(type:'speed', 'Production Pickup Truck with speed of 271kph') } car(name:'P50', make:'Peel', year:1962) { country('Isle of Man') record(type:'size', 'Smallest Street-Legal Car at 99cm wide and 59 kg in weight') } car(name:'Royale', make:'Bugatti', year:1931) { country('France') record(type:'price', 'Most Valuable Car at $15 million') } } println writer.toString()
  • 51.
  • 52.
  • 53. The Rails guys invented the “movie to demo the framework” idea and their movies are still WOW OH WOW GOOD
  • 54.
  • 55. In 4 years, Rails has made very impressive strides. Market leader in the “early stage startup” category.
  • 56.
  • 57. Backwards compatibility is not a huge priority
  • 58. Backwards compatibility is not a huge priority
  • 60. Of course, Java is mostly developed by Sun ….
  • 61. This is from a Ruby guy who doesn’t like JRuby very much …
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67. SWAG Estimate: About ¾ of plugins are mentioned here (BIRT, for example, is not)
  • 68.
  • 69.
  • 71.
  • 72.
  • 73.
  • 74.
  • 76. This is a great series of articles. Whenever anyone tells you a technology is going to be big, ask yourself: WWTT?
  • 77.  
  • 78.