Groovy & Grails(also) the future of Java Web Development<br />Yuval Goldstein, <br />yuvalgo@gmail.com,<br />@yuvalgo<br />
Groovy, Grails, Agenda<br />Beyond Java<br />What’s groovy?<br />What’s grails?<br />How people use them?<br />
Beyond Java<br />Java= Language + Classes +JVM<br />JEE = Robust spec to support server-driven apps<br />The good: OO, pop...
Beyond Java<br />Java code &gt; compiled into bytecode &gt; JVM<br />The JVM supports other languages:<br />Groovy<br />Sc...
Groovy<br />Cool language, compiles into bytecode<br />Similar to Java, a lot of additions and improvements:<br />Language...
Demo<br />Let’s take a Java class and show how it’s done in Groovy<br />
Closures<br />A piece of code that can be passes around and executed (sort of an Anonymous class with a method)<br />
More Closures<br />
Demo<br />Let’s see some Collections and Closures working together<br />
Groovy typing<br />Types can be specified and enforced<br />Types can unspecified and deducted (Duck Typing)<br />
Duck Typing<br />Behavior of objects is determines by their own methods and members rather than by declarations<br />
Duck Season? - Demo<br />Let’s see how duck typing works<br />
Duck Typing<br />Sacrifice certainty for laziness, WTF?<br />Some application really need strict typing, other doesn’t<br ...
Expando Classes<br />
String Matching<br />
Introducing Grails<br />Grails=Groovy + Spring + Hibernate + Sitemesh<br />A framework for developing web-apps with pleasu...
Demo<br />Create an empty application<br />Develop a domain classes<br />Generate a trivial CRUD : dynamic, then static<br />
Domain Objects and GORM<br />GORM: Hibernate DSL<br />1:1, 1:N, M:N, Object hierarchies, Versioning, Cascade, Fetch<br />O...
Controllers<br />Each closure maps to a request name<br />Render templates, GSP, XML, JSON<br />Automatic variables: param...
Views<br />GSPs, taglibs, Templates<br />HTML centric<br />Built in Tags for: Forms and error handling , AJAX, Pagination,...
Services<br />Help re-use code, scope transaction, expose web-services<br />Different Scopes: singleton, session, prototyp...
Testing support<br />Built-in Unit and Integration testing<br />Good mockup support<br />Can’t do without it<br />
(Only some) Plugins<br />GrailsUI<br />Acegi Security<br />Twitter<br />Flex<br />Quartz<br />Searchable<br />
Groovy, Grails in the wild<br />Groovy:<br />As a scripting tool for developers<br />For testing plain java code<br />For ...
Community and support<br />Open-Source, use for free<br />Commercial training and support by spring<br />Grails user newsg...
Who use Grails?<br />Linkedin.com<br />Sky.com<br />twitcaps.com<br />blerp.com<br />twitsms.co.uk<br />Ganttzilla.com<br ...
Summary<br />Grails is ideal for small and medium size application <br />Grails ~= Rails capabilities + JVM + All existing...
Thanks !<br />
Upcoming SlideShare
Loading in...5
×

Alphageeks IL #2 Groovy & Grails

1,140

Published on

Second Alphageeks IL meetup:
Yuval Goldstein talks on Groovy & Grails and the shift from static typing to dynamic typing.

Check us out for more events:
http://alphageeks.blogli.co.il/

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,140
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
54
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Alphageeks IL #2 Groovy & Grails

  1. 1. Groovy & Grails(also) the future of Java Web Development<br />Yuval Goldstein, <br />yuvalgo@gmail.com,<br />@yuvalgo<br />
  2. 2. Groovy, Grails, Agenda<br />Beyond Java<br />What’s groovy?<br />What’s grails?<br />How people use them?<br />
  3. 3. Beyond Java<br />Java= Language + Classes +JVM<br />JEE = Robust spec to support server-driven apps<br />The good: OO, popular, tons of frameworks, enterprise ready (queues, transactions, web-services)<br />The Bad: Verbose, long turn-around, mix and match your own framework<br />
  4. 4. Beyond Java<br />Java code &gt; compiled into bytecode &gt; JVM<br />The JVM supports other languages:<br />Groovy<br />Scala<br />JRuby<br />Jython<br />But WHY? : Because not every problem should be solved by a general purpose language<br />
  5. 5. Groovy<br />Cool language, compiles into bytecode<br />Similar to Java, a lot of additions and improvements:<br />Language level support for collections<br />Closures and Builders<br />Dynamic typing<br />Concise syntax<br />Groovy2Java, Java2Groovy integration<br />
  6. 6. Demo<br />Let’s take a Java class and show how it’s done in Groovy<br />
  7. 7. Closures<br />A piece of code that can be passes around and executed (sort of an Anonymous class with a method)<br />
  8. 8. More Closures<br />
  9. 9. Demo<br />Let’s see some Collections and Closures working together<br />
  10. 10. Groovy typing<br />Types can be specified and enforced<br />Types can unspecified and deducted (Duck Typing)<br />
  11. 11. Duck Typing<br />Behavior of objects is determines by their own methods and members rather than by declarations<br />
  12. 12. Duck Season? - Demo<br />Let’s see how duck typing works<br />
  13. 13. Duck Typing<br />Sacrifice certainty for laziness, WTF?<br />Some application really need strict typing, other doesn’t<br />Frameworks generate a lot of code for you on runtime<br />Faster code changes<br />Good testing really helps<br />You already doing it:<br />HTML, CSS, SQL, JSP<br />
  14. 14. Expando Classes<br />
  15. 15. String Matching<br />
  16. 16. Introducing Grails<br />Grails=Groovy + Spring + Hibernate + Sitemesh<br />A framework for developing web-apps with pleasure<br />Open-Source, supported by Spring-Source<br />Convention over configuration<br />Model-driven <br />Short turnaround<br />Good developer-testing support<br />A lot more…<br />
  17. 17. Demo<br />Create an empty application<br />Develop a domain classes<br />Generate a trivial CRUD : dynamic, then static<br />
  18. 18. Domain Objects and GORM<br />GORM: Hibernate DSL<br />1:1, 1:N, M:N, Object hierarchies, Versioning, Cascade, Fetch<br />Objects are DAOs<br />Automatic Query Syntax:<br />Object.save()<br />Object.get(id)<br />Object.findAll()<br />
  19. 19. Controllers<br />Each closure maps to a request name<br />Render templates, GSP, XML, JSON<br />Automatic variables: param, session, flash<br />Support Spring Webflow<br />Dependency Injection support (for services)<br />
  20. 20. Views<br />GSPs, taglibs, Templates<br />HTML centric<br />Built in Tags for: Forms and error handling , AJAX, Pagination, uploads<br />Pluggable Ajax support: Prototype, YUI, others<br />Plugins: Grails-UI, Flex, GWT, Open Lazzlo, Portlet integration<br />
  21. 21. Services<br />Help re-use code, scope transaction, expose web-services<br />Different Scopes: singleton, session, prototype, request, conversation, flow<br />Dependency Injection support<br />Plugins: JMS integration, Quartz Jobs, Xfire/Spring web-services, etc…<br />
  22. 22. Testing support<br />Built-in Unit and Integration testing<br />Good mockup support<br />Can’t do without it<br />
  23. 23. (Only some) Plugins<br />GrailsUI<br />Acegi Security<br />Twitter<br />Flex<br />Quartz<br />Searchable<br />
  24. 24. Groovy, Grails in the wild<br />Groovy:<br />As a scripting tool for developers<br />For testing plain java code<br />For developing swing code (special DSL)<br />For coding grails application<br />Grails:<br />Prototypes and back-office applications<br />Grails Frontend with Java backend<br />Grails frontend and backend<br />
  25. 25. Community and support<br />Open-Source, use for free<br />Commercial training and support by spring<br />Grails user newsgroup on Nabble: 40-80 messages a day<br />IDEs: Eclipse, Intellij, Netbeans, TextMate<br />Books:Groovy in action, Grails in Action, Definitive Guide to Grails, Getting started with Grails, Groovy & Grails Recepies, more…<br />Sites:grails.org, aboutgroovy.com, grailspodcast.com, grailstutorials.com<br />
  26. 26. Who use Grails?<br />Linkedin.com<br />Sky.com<br />twitcaps.com<br />blerp.com<br />twitsms.co.uk<br />Ganttzilla.com<br />Lot’s of community, e-commerce and twitter oriented sites<br />
  27. 27. Summary<br />Grails is ideal for small and medium size application <br />Grails ~= Rails capabilities + JVM + All existing Java frameworks<br />0 Setup development environment<br />Fun to use<br />
  28. 28. Thanks !<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×