1. Scala Days 2013
Gilt Groupe
ebowman@gilt.com
http://www.flickr.com/photos/justusthane/1252907196/
2. Gilt provides insider access to today’s top designer labels, at up to 60% off retail.
Through our daily flash sales, which begin at noon EST, we offer everything from
high-end designer clothing and home furnishings to fine dining experiences. Our
products are grouped into five stores: Women, Men, Baby & Kids, Home and City.
Working from New York City, Dublin, or home/remotely, Gilt Tech’s 120 engineers
develop all of our technology in-house. Since Gilt’s founding days, we have
pursued a structure that enables us to address unique needs other e-commerce
platforms simply cannot support. These needs include the ability to handle
intense traffic spikes, offer prompt customer service, manage operations
(inventory, payments and shipping), and execute many other tasks.
As a rapidly growing company with an international customer base, Gilt’s priorities
focus on scalability and personalization. Gilt.com was originally built on Ruby on
Rails, but our rapid growth quickly led to scalability issues — prompting us to
migrate many parts of our website to the Java Virtual Machine. In 2011 we began
migrating our operations to Scala, which is currently our core stack.
9. UniformAccessPrinciple
Java Scala
public class Datum {
public final int x;
public Datum(int x) {
this.x = x;
}
}
class Datum(val x: Int)
public class Datum {
private final int y;
public int x() {
return f(g(y));
}
public Datum(int y) {
this.y = y;
}
}
class Datum(y: Int) {
def x = f(g(y))
}
“All services offered by a module should be available through a
uniform notation, which does not betray whether they are implemented
through storage or through computation” - Bertrand Meyer
http://en.wikipedia.org/wiki/Uniform_access_principle
13. PatternMatching
x match {
case even if (x % 2) == 0 => even/2
case odd => odd + 1
}
catch {
case io: IOException => ...
case e: Exception => ...
}
14. PatternMatching
x match {
case even if (x % 2) == 0 => even/2
case odd => odd + 1
}
catch {
case io: IOException => ...
case e: Exception => ...
}
val split: String => String = {
case null => None
case str => Some(str)
}