Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Key Points

  1. Gorm is an ORM for RDBs ( specifically MySQL,Postgres, MS SQL, sqlite ) with the ability to create dialects to support other databases
  2. Gorm uses Groovy scripting to define data models and relations
  3. Gorm models can be used in Grails to scaffold Web applications and REST services


References

Reference_description_with_linked_URLs____________________________Notes_______________________________________________________________




https://objectcomputing.com/files/6415/6694/2515/slide_deck_Groovy_3_and_Beyond_webinar.pdf

https://drive.google.com/open?id=1-BgJaeRWcU1Dl5Aa_-LUqNFDWkOUstYN

Groovy 3 and beyond
http://www.groovy-lang.org/closures.html#_groovy_closures_vs_lambda_expressionsGroovy closures vs Lambda expressions

file:///C:/Users/Jim%20Mason/Google%20Drive/_docs/howto/groovy/regex%20-%20Regular%20Expressions%20-%20A%20Gentle%20
User%20Guide%20and%20Tutorial.pdf

Regex rules

Slide_Deck_Groovy_for_Data_Science_Webinar.pdf

Groovy Data Science Tools - Paul King



Groovy 3x changes
http://groovy-lang.org/releasenotes/groovy-3.0.htmlGroovy 3x supports Lambda expressions too
https://docs.groovy-lang.org/docs/groovy-3.0.0-rc-1/html/documentation/Groovy 3x documentation


GORM
https://gorm.grails.org/
https://docs.grails.org/3.0.x/guide/GORM.html
https://gorm.grails.org/

gorm-tips-gr8conf-eu-2018-180601112357.pdf

https://www.slideshare.net/alvarosanchezmariscal/6-things-
you-need-to-know-about-gorm-6


gorm-data-access-toolkit-gids2017nareshagorm-170427103711.pdf

https://www.slideshare.net/nareshak/gorm-the-polyglot-data-access-toolkit


gorm-overview-2012-gormoverviewforsdforumjavasig2009-1231454414107214-1.pdf

https://www.slideshare.net/chris.e.richardson/overview-of-grails-object-relational-mapping-gorm-presentation


gorm-basics-2014-grailsgorm-141201080405-conversion-gate02.pdf
gorm-overview-2012-gormoverviewforsdforumjavasig2009-1231454414107214-1.pdf
gorm-data-access-toolkit-gids2017nareshagorm-170427103711.pdf
gorm-tips-gr8conf-eu-2018-180601112357.pdf


gorm-basics-2014-grailsgorm-141201080405-conversion-gate02.pdf

https://www.slideshare.net/TedVinke/grails-gorm


gorm-inside-and=out-jeff-scott-brown-2015--141105160207-conversion-gate01.pdf

https://www.slideshare.net/SpringCentral/gorm-inside-andout


advanced-gorm-graeme-rocher-141103185142-conversion-gate01.pdf

https://www.slideshare.net/SpringCentral/2-gx-2014-advanced-gorm


grails-gorm-2014-141201080405-conversion-gate02.pdf


gorm-inside-and-out-2016-g-rocher-160607123907.pdf

https://www.slideshare.net/graemerocher/gr8conf-2016-gorm-inside-and-out








Groovy DSLs




https://www.slideshare.net/paulk_asert/groovy-dsls-from-beginner-to-expertGroovy DSLs - Paul King, Guillaume LaForge - detailed
https://www.slideshare.net/glaforge/practical-groovy-dslGroovy DSLs in Practice - Guillaume LaForge - good
https://www.slideshare.net/NexThoughts/groovy-dsl-62615687DSL in Groovy - short
https://www.slideshare.net/paulbowler/dsls-with-groovyDSLs with Groovy - Paul Bowler


Groovy Frameworks

https://examples.javacodegeeks.com/core-java/spock-tutorial-beginners/Groovy Spock Tutorial for use case tests: given, when, then, so
https://gebish.org/Geb - web automation w WebDriver, JQuery, Objects
Gradle
https://docs.gradle.org/current/userguide/getting_started.htmlGradle Getting Started
https://gradle.org/guides/Gradle basics
https://docs.gradle.org/current/userguide/declaring_repositories.htmlGradle for builds
https://circleci.com/docs/2.0/language-java/CircleCi gradle builds
Libraries

Mavencentral for libraries

Github for libraries

JCenter for Java libs











Key Concepts



Groovy 3 Key Features

http://groovy-lang.org/releasenotes/groovy-3.0.html

supports JDK 11, JDK 9 and JDK 8 at runtime

onlyJDK 11, JDK 9 supported at build time


Java-style Lambda syntax

The Java syntax for lambda expressions is now supported.

Examples:

(1..10).forEach(e -> { println e })

assert (1..10).stream()
                .filter(e -> e % 2 == 0)
                .map(e -> e * 2)
                .toList() == [4, 8, 12, 16, 20]


The normal variants are supported and Groovy adds additional features such as default parameter values:

// general form
def add = (int x, int y) -> { def z = y; return x + z }
assert add(3, 4) == 7

// curly braces are optional for a single expression
def sub = (int x, int y) -> x - y
assert sub(4, 3) == 1

// parameter types are optional
def mult = (x, y) -> x * y
assert mult(3, 4) == 12

// no parentheses required for a single parameter with no type
def isEven = n -> n % 2 == 0
assert isEven(6)
assert !isEven(7)

// no arguments case
def theAnswer = () -> 42
assert theAnswer() == 42

// any statement requires braces
def checkMath = () -> { assert 1 + 1 == 2 }
checkMath()

// example showing default parameter values (no Java equivalent)
def addWithDefault = (int x, int y = 100) -> x + y
assert addWithDefault(1, 200) == 201
assert addWithDefault(1) == 101



Potential Value Opportunities



Potential Challenges


Bug> Groovyconsole can't open groovy file from menu or cli


bug> can't open a file from groovyconsole using the file menu

workaround> use CTL + O

  1. open groovyconsole normally
  2. use CTL + O to open file selector window
  3. select a groovy file
  4. press Enter
  5. << file opens normally in groovy console


Candidate Solutions



Step-by-step guide for Example



sample code block

sample code block
 



Recommended Next Steps



  • No labels