Current
Previous Versions
Professional
Experience
source: http://tjvantoll.com/2014/12/29/so-you-want-to-write-a-tech-book/Minneapolis, MN
Gr8Ladies Products
class Product {
String name
Vendor vendor
String chapter
String imageUrl
String vendorUrlPath
SortedSet priceQuantityRelations
Integer minQuantity
static hasMany = [priceQuantityRelations: PriceQuantityRelation]
static constraints = {
chapter nullable: true
imageUrl nullable: true
minQuantity min: 1
}
static mapping = {
priceQuantityRelations sort: 'quantity'
}
}
package org.gr8ladies
class Vendor {
String name
String url
static constraints = {
url(url: true)
}
}
class PriceQuantityRelation implements Comparable {
BigDecimal price
Integer quantity
BigDecimal unitPrice
static belongsTo = [product: Product]
static constraints = {
quantity min: 1
price min: 0.00, scale: 2
unitPrice min: 0.00, scale: 4
}
String getDisplayName() {
quantity + ' for $' + price + '($' + unitPrice + ' each)'
}
int compareTo(obj) {
quantity.compareTo(obj.quantity)
}
}
class Cart {
String userSession
static hasMany = [cartItems: CartItem]
static constraints = {
}
Integer getSize() {
this.cartItems?.size() ?: 0
}
BigDecimal getTotalPrice() {
BigDecimal sum = cartItems?.sum { item ->
item.priceQuantityRelation.unitPrice *
item.priceQuantityRelation.quantity
}
sum ? sum.setScale(2) : 0.00
}
}
package org.gr8ladies
class CartItem {
PriceQuantityRelation priceQuantityRelation
static belongsTo = [cart: Cart]
static constraints = {
}
}
Status | ||
---|---|---|
Jedis | ||
Grails Redis | ||
Redis GORM | Last Updated June 2014 | |
Memcached 2nd-Level Cache Plugin | Last Updated December 2011 | |
DynamoDB GORM | Last Updated April 2012 |
Status | ||
---|---|---|
GMongo | Last Updated March 2015 | |
MongoDB GORM | ||
CouchDB GORM | Last Updated April 2011 | |
CouchDB REST API |
SPARQL
Status | ||
---|---|---|
Neo4j Native REST API | ||
Neo4j GORM | Last Updated June 2014 |
All In - MongoDB GORM
Terminology
Partial - Grails-Redis plugin
Terminology
jenn@gr8ladies.org