SlideShare a Scribd company logo
1 of 23
(A case for) GRAILS Mark Daugherty CITYTECH, Inc. July 7th, 2010
Outline Inspiration Grails overview Comparison of Java/Spring/JPA application to Groovy/Grails
Context February 2010 : wrote a small Groovy/Grails app to learn the technologies March 1st, 2010 : started on CDGA project (Struts, Spring, JPA) March 1st, 2010 (later that day) : realized that CDGA had an enormous amount of boilerplate code that Grails could eliminate
(Additional) Context May 7th, 2010 : wrote CITYTECH blog post about code savings from replacing Spring DAO code with Grails May 8th, 2010 – present : blog is read by a total of 4 CITYTECH employees July 7th, 2010 : Grails begins to learn at a geometric rate.  It becomes self-aware at 2:14 AM, Eastern time.
Grails Primer Web application framework built with Groovy (Java-based dynamic language) on top of proven Java technologies Spring MVC, Hibernate Full stack for rapid development Embedded Tomcat container, HSQLDB, (G)Ant, scaffolding features Get a basic app running within minutes
You may notice… Convention over configuration Little-to-no initial configuration Project structure is predefined according to best practices Command line scripts for common tasks Create new application, compile, test, run Generate domain classes, controllers, services, test cases Install plugins Contrast with your last Maven-built project
In practice…
Simple Domain Delegate 1  ∞ User Delegate 1  ∞ Application A “delegate agency” has one-to-many users and one-to-many applications.  An application contains various forms, input by users, to collect data about the delegate agency.
JPA (Java Persistence API) @Entity @Table(name = "USER") public class User implements Serializable {     @Id     private Integer id;     @OneToOne(fetch = FetchType.LAZY)     @JoinColumn(name = "DELEGATE", referencedColumnName = "ID")     private Delegate delegate;     // getters and setters, equals(), hashCode(), toString()… }
(More) JPA @Entity @Table(name = "DELEGATE") public class Delegate implements Serializable {     @Id     private Integer id;     @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)     private Set<User> users;     @OneToMany(cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)     private Set<Application> applications; 	 // getters and setters, equals(), hashCode(), toString()... }
(Still more) JPA @Entity @Table(name = "APPLICATION") public class Application implements Serializable {     @Id     private Integer id;     @ManyToOne(cascade = { CascadeType.REFRESH }, optional = false)     @JoinColumn(name = "DELEGATE”)     private Delegate delegate; 	// getters and setters, equals(), hashCode(), toString()... }
Grails class User { 	static belongsTo = [delegate:Delegate] } class Delegate { 	static hasMany = [users:User, applications:Application] 	static mapping = { 	    users lazy:false 		   applications cascade:'delete' 	} } class Application { 	static belongsTo = [delegate:Delegate] 	static mapping = { 		   delegate cascade:'refresh' 	} }
DAO JPA/Hibernate = verbose, repetitive Even a small domain model can have 1000’s of lines of code for basic CRUD operations Tedious to maintain
GORM! Hibernate under the hood Groovy + runtime code synthesis to eliminate boilerplate code
Basic CRUD
Dynamic Finders
Additional GORM Features ORM DSL for mapping to legacy DB schemas Custom mappings for non-standard table and column names Event handlers (beforeInsert, afterUpdate) Customizable caching and fetching strategies, transactions
Web Render XML or JSON responses using markup builders Automatic marshalling of domain classes to XML/JSON
(More) Web GSP Similar to JSP, but with better tag libraries findAll, grep (filter) for collections Method calls Templates Sitemesh (decorator) layouts Customizable URL mappings
Validation Often painful, less so with Grails
More Features Spring Web Flow Supports subflows, conversation scope (similar to Seam) Interceptors / Filters AJAX DOJO, GWT plugins
Even more to like Groovy tests Ideal for TDD Unit tests created automatically from command line script Dynamic language features for easy mocking Easy RESTful web services URL mappings Controllers can render XML or JSON Consider attending a CGUG meeting Extremely active community 400+ plugins (Spring Security, JQuery, GWT, Google App Engine, Flex) Wide range of tutorials Frequent releases
Summary Grails compared to Spring, EJB, JPA Substantially less code without compromises Easier to maintain and test Shorter iterations and release cycles Same proven underlying technologies Gain competitive edge Why not?

More Related Content

What's hot

What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...Kim Clark
 
Keyword Services Platform (KSP) from Microsoft adCenter
Keyword Services Platform (KSP) from Microsoft adCenterKeyword Services Platform (KSP) from Microsoft adCenter
Keyword Services Platform (KSP) from Microsoft adCentergoodfriday
 
External - IT Specialist
External - IT SpecialistExternal - IT Specialist
External - IT SpecialistJacob Wardon
 
Actively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net DeveloperActively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net DeveloperKarthik Reddy
 
Differentiating between web APIs, SOA, & integration …and why it matters
Differentiating between web APIs, SOA, & integration…and why it mattersDifferentiating between web APIs, SOA, & integration…and why it matters
Differentiating between web APIs, SOA, & integration …and why it mattersKim Clark
 
20101007 how smart use cases drive web development
20101007   how smart use cases drive web development20101007   how smart use cases drive web development
20101007 how smart use cases drive web developmentSander Hoogendoorn
 
Opac labs overview-pr1.0
Opac labs overview-pr1.0Opac labs overview-pr1.0
Opac labs overview-pr1.0opaclabs
 
Taking a REST and being HAPI
Taking a REST and being HAPITaking a REST and being HAPI
Taking a REST and being HAPIChris Davenport
 
Joomla in a world of ubiquitous computing
Joomla in a world of ubiquitous computingJoomla in a world of ubiquitous computing
Joomla in a world of ubiquitous computingChris Davenport
 
React js vs react native a comparative analysis
React js vs react native a comparative analysisReact js vs react native a comparative analysis
React js vs react native a comparative analysisShelly Megan
 
We don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppWe don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppPat Patterson
 
S Kumar Resume
S Kumar ResumeS Kumar Resume
S Kumar ResumeS Kumar
 
Sanjeev_Kumar_Paul- Resume-Latest
Sanjeev_Kumar_Paul- Resume-LatestSanjeev_Kumar_Paul- Resume-Latest
Sanjeev_Kumar_Paul- Resume-LatestSanjeev Kumar Paul
 
2015-05-19-resume
2015-05-19-resume2015-05-19-resume
2015-05-19-resumeLee Norris
 

What's hot (20)

What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...What’s behind a high quality web API? Ensure your APIs are more than just a ...
What’s behind a high quality web API? Ensure your APIs are more than just a ...
 
Resume
ResumeResume
Resume
 
Keyword Services Platform (KSP) from Microsoft adCenter
Keyword Services Platform (KSP) from Microsoft adCenterKeyword Services Platform (KSP) from Microsoft adCenter
Keyword Services Platform (KSP) from Microsoft adCenter
 
Gangadhar_Challa_Profile
Gangadhar_Challa_ProfileGangadhar_Challa_Profile
Gangadhar_Challa_Profile
 
External - IT Specialist
External - IT SpecialistExternal - IT Specialist
External - IT Specialist
 
Actively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net DeveloperActively looking for an opportunity to work as a challenging Dot Net Developer
Actively looking for an opportunity to work as a challenging Dot Net Developer
 
Differentiating between web APIs, SOA, & integration …and why it matters
Differentiating between web APIs, SOA, & integration…and why it mattersDifferentiating between web APIs, SOA, & integration…and why it matters
Differentiating between web APIs, SOA, & integration …and why it matters
 
DOT NET RESUME
DOT NET RESUMEDOT NET RESUME
DOT NET RESUME
 
20101007 how smart use cases drive web development
20101007   how smart use cases drive web development20101007   how smart use cases drive web development
20101007 how smart use cases drive web development
 
Opac labs overview-pr1.0
Opac labs overview-pr1.0Opac labs overview-pr1.0
Opac labs overview-pr1.0
 
Taking a REST and being HAPI
Taking a REST and being HAPITaking a REST and being HAPI
Taking a REST and being HAPI
 
Surya resume WSU
Surya resume WSUSurya resume WSU
Surya resume WSU
 
Joomla in a world of ubiquitous computing
Joomla in a world of ubiquitous computingJoomla in a world of ubiquitous computing
Joomla in a world of ubiquitous computing
 
React js vs react native a comparative analysis
React js vs react native a comparative analysisReact js vs react native a comparative analysis
React js vs react native a comparative analysis
 
We don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile AppWe don’t need no stinkin app server! Building a Two-Tier Mobile App
We don’t need no stinkin app server! Building a Two-Tier Mobile App
 
Resume
ResumeResume
Resume
 
S Kumar Resume
S Kumar ResumeS Kumar Resume
S Kumar Resume
 
Sanjeev_Kumar_Paul- Resume-Latest
Sanjeev_Kumar_Paul- Resume-LatestSanjeev_Kumar_Paul- Resume-Latest
Sanjeev_Kumar_Paul- Resume-Latest
 
Mobile Apps Develpment - A Comparison
Mobile Apps Develpment - A ComparisonMobile Apps Develpment - A Comparison
Mobile Apps Develpment - A Comparison
 
2015-05-19-resume
2015-05-19-resume2015-05-19-resume
2015-05-19-resume
 

Viewers also liked

[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'
[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'
[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'Lucy Hull
 
Easy way to embed video
Easy way to embed videoEasy way to embed video
Easy way to embed videoguest3b3fc2
 
Tugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan PembelajaranTugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan Pembelajaranlindiani
 
Tugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan PembelajaranTugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan Pembelajaranlindiani
 
Introduction to derivatives
Introduction to derivatives Introduction to derivatives
Introduction to derivatives Saifu Rather
 
The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...
The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...
The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...Publishing Technology
 
Group Project
Group ProjectGroup Project
Group Projectdarnay12
 
Mokama reklama Facebook.com tinkle
Mokama reklama Facebook.com tinkleMokama reklama Facebook.com tinkle
Mokama reklama Facebook.com tinklePDFONTOUR
 
Takahe by Jacob, Claire, Yuan and Karen L
Takahe by Jacob, Claire, Yuan and Karen LTakahe by Jacob, Claire, Yuan and Karen L
Takahe by Jacob, Claire, Yuan and Karen LHelenOfTroy
 
English introduction
English introductionEnglish introduction
English introductiongabriela
 
Itunes vs rhapsody
Itunes vs rhapsodyItunes vs rhapsody
Itunes vs rhapsodycmcsoley458
 
1อนุชิตเผยแพร่
1อนุชิตเผยแพร่1อนุชิตเผยแพร่
1อนุชิตเผยแพร่somdetpittayakom school
 
《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)Chada Chiu
 

Viewers also liked (20)

92
9292
92
 
Pwp Actors
Pwp ActorsPwp Actors
Pwp Actors
 
Kurikulum Dan Pembelajaran
Kurikulum Dan PembelajaranKurikulum Dan Pembelajaran
Kurikulum Dan Pembelajaran
 
[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'
[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'
[Matt Morrison] The Societal Web: How we can Model & Measure 'Influence'
 
Easy way to embed video
Easy way to embed videoEasy way to embed video
Easy way to embed video
 
Linkedin
LinkedinLinkedin
Linkedin
 
Tugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan PembelajaranTugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan Pembelajaran
 
Asuhan keperawatan lansia 2013 diii kep
Asuhan keperawatan lansia 2013 diii kepAsuhan keperawatan lansia 2013 diii kep
Asuhan keperawatan lansia 2013 diii kep
 
10 Things to Do at SXSW
10 Things to Do at SXSW10 Things to Do at SXSW
10 Things to Do at SXSW
 
Tugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan PembelajaranTugas Kurikulum Dan Pembelajaran
Tugas Kurikulum Dan Pembelajaran
 
Introduction to derivatives
Introduction to derivatives Introduction to derivatives
Introduction to derivatives
 
The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...
The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...
The Semantic Web and Book Publishing - Supply Chain Seminar, London Book Fair...
 
Group Project
Group ProjectGroup Project
Group Project
 
Mokama reklama Facebook.com tinkle
Mokama reklama Facebook.com tinkleMokama reklama Facebook.com tinkle
Mokama reklama Facebook.com tinkle
 
Takahe by Jacob, Claire, Yuan and Karen L
Takahe by Jacob, Claire, Yuan and Karen LTakahe by Jacob, Claire, Yuan and Karen L
Takahe by Jacob, Claire, Yuan and Karen L
 
English introduction
English introductionEnglish introduction
English introduction
 
Herhaling V2B
Herhaling V2BHerhaling V2B
Herhaling V2B
 
Itunes vs rhapsody
Itunes vs rhapsodyItunes vs rhapsody
Itunes vs rhapsody
 
1อนุชิตเผยแพร่
1อนุชิตเผยแพร่1อนุชิตเผยแพร่
1อนุชิตเผยแพร่
 
《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)《氪周刊:互联网创业必读》(第65期)
《氪周刊:互联网创业必读》(第65期)
 

Similar to A Case for Grails

Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Guillaume Laforge
 
sMash at May NYPHP UG
sMash at May NYPHP UGsMash at May NYPHP UG
sMash at May NYPHP UGProject Zero
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
 
Compass Framework
Compass FrameworkCompass Framework
Compass FrameworkLukas Vlcek
 
Java one 2010
Java one 2010Java one 2010
Java one 2010scdn
 
Java Technology
Java TechnologyJava Technology
Java Technologyifnu bima
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web DevelopmentRobert J. Stein
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaDavid Chandler
 
Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J) Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J) Lars Vogel
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009marpierc
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansCarol McDonald
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3gvasya10
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than YouRobert Cooper
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedPeter Lubbers
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCJim Tochterman
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005Tugdual Grall
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Google App Engine With Java And Groovy
Google App Engine With Java And GroovyGoogle App Engine With Java And Groovy
Google App Engine With Java And GroovyKen Kousen
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 

Similar to A Case for Grails (20)

Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007Grails Introduction - IJTC 2007
Grails Introduction - IJTC 2007
 
sMash at May NYPHP UG
sMash at May NYPHP UGsMash at May NYPHP UG
sMash at May NYPHP UG
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
Compass Framework
Compass FrameworkCompass Framework
Compass Framework
 
Java one 2010
Java one 2010Java one 2010
Java one 2010
 
Java Technology
Java TechnologyJava Technology
Java Technology
 
Advanced Web Development
Advanced Web DevelopmentAdvanced Web Development
Advanced Web Development
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
 
Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J) Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J)
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
 
Agile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with NetbeansAgile web development Groovy Grails with Netbeans
Agile web development Groovy Grails with Netbeans
 
my test
my testmy test
my test
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3g
 
GWT is Smarter Than You
GWT is Smarter Than YouGWT is Smarter Than You
GWT is Smarter Than You
 
HTML5 Web Workers-unleashed
HTML5 Web Workers-unleashedHTML5 Web Workers-unleashed
HTML5 Web Workers-unleashed
 
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NCAndroid Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
Android Development w/ ArcGIS Server - Esri Dev Meetup - Charlotte, NC
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Google App Engine With Java And Groovy
Google App Engine With Java And GroovyGoogle App Engine With Java And Groovy
Google App Engine With Java And Groovy
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 

Recently uploaded

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
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
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
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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
 
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
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
"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
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 

Recently uploaded (20)

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
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
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
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
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
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
"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 ...
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 

A Case for Grails

  • 1. (A case for) GRAILS Mark Daugherty CITYTECH, Inc. July 7th, 2010
  • 2. Outline Inspiration Grails overview Comparison of Java/Spring/JPA application to Groovy/Grails
  • 3. Context February 2010 : wrote a small Groovy/Grails app to learn the technologies March 1st, 2010 : started on CDGA project (Struts, Spring, JPA) March 1st, 2010 (later that day) : realized that CDGA had an enormous amount of boilerplate code that Grails could eliminate
  • 4. (Additional) Context May 7th, 2010 : wrote CITYTECH blog post about code savings from replacing Spring DAO code with Grails May 8th, 2010 – present : blog is read by a total of 4 CITYTECH employees July 7th, 2010 : Grails begins to learn at a geometric rate. It becomes self-aware at 2:14 AM, Eastern time.
  • 5. Grails Primer Web application framework built with Groovy (Java-based dynamic language) on top of proven Java technologies Spring MVC, Hibernate Full stack for rapid development Embedded Tomcat container, HSQLDB, (G)Ant, scaffolding features Get a basic app running within minutes
  • 6. You may notice… Convention over configuration Little-to-no initial configuration Project structure is predefined according to best practices Command line scripts for common tasks Create new application, compile, test, run Generate domain classes, controllers, services, test cases Install plugins Contrast with your last Maven-built project
  • 8. Simple Domain Delegate 1  ∞ User Delegate 1  ∞ Application A “delegate agency” has one-to-many users and one-to-many applications. An application contains various forms, input by users, to collect data about the delegate agency.
  • 9. JPA (Java Persistence API) @Entity @Table(name = "USER") public class User implements Serializable { @Id private Integer id; @OneToOne(fetch = FetchType.LAZY) @JoinColumn(name = "DELEGATE", referencedColumnName = "ID") private Delegate delegate; // getters and setters, equals(), hashCode(), toString()… }
  • 10. (More) JPA @Entity @Table(name = "DELEGATE") public class Delegate implements Serializable { @Id private Integer id; @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER) private Set<User> users; @OneToMany(cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY) private Set<Application> applications; // getters and setters, equals(), hashCode(), toString()... }
  • 11. (Still more) JPA @Entity @Table(name = "APPLICATION") public class Application implements Serializable { @Id private Integer id; @ManyToOne(cascade = { CascadeType.REFRESH }, optional = false) @JoinColumn(name = "DELEGATE”) private Delegate delegate; // getters and setters, equals(), hashCode(), toString()... }
  • 12. Grails class User { static belongsTo = [delegate:Delegate] } class Delegate { static hasMany = [users:User, applications:Application] static mapping = { users lazy:false applications cascade:'delete' } } class Application { static belongsTo = [delegate:Delegate] static mapping = { delegate cascade:'refresh' } }
  • 13. DAO JPA/Hibernate = verbose, repetitive Even a small domain model can have 1000’s of lines of code for basic CRUD operations Tedious to maintain
  • 14. GORM! Hibernate under the hood Groovy + runtime code synthesis to eliminate boilerplate code
  • 17. Additional GORM Features ORM DSL for mapping to legacy DB schemas Custom mappings for non-standard table and column names Event handlers (beforeInsert, afterUpdate) Customizable caching and fetching strategies, transactions
  • 18. Web Render XML or JSON responses using markup builders Automatic marshalling of domain classes to XML/JSON
  • 19. (More) Web GSP Similar to JSP, but with better tag libraries findAll, grep (filter) for collections Method calls Templates Sitemesh (decorator) layouts Customizable URL mappings
  • 20. Validation Often painful, less so with Grails
  • 21. More Features Spring Web Flow Supports subflows, conversation scope (similar to Seam) Interceptors / Filters AJAX DOJO, GWT plugins
  • 22. Even more to like Groovy tests Ideal for TDD Unit tests created automatically from command line script Dynamic language features for easy mocking Easy RESTful web services URL mappings Controllers can render XML or JSON Consider attending a CGUG meeting Extremely active community 400+ plugins (Spring Security, JQuery, GWT, Google App Engine, Flex) Wide range of tutorials Frequent releases
  • 23. Summary Grails compared to Spring, EJB, JPA Substantially less code without compromises Easier to maintain and test Shorter iterations and release cycles Same proven underlying technologies Gain competitive edge Why not?