Fluent Validation Framework - A DSL for validations using fluent interfaces
1.
2. Overall presenta3on
Introduc3on to Domain Specific Languages and
its techniques. As well as showing Fluent
Valida3on Framework concep3on process.
www.devoxx.com
11. For example, while a business analyst of
a banking domain would say
Transfer 5.000,00 from Client A's cash account to Client B's savings account.
www.devoxx.com
25. Trigger method at the end of the expression
ensure(arg0).isNotNull().now();
ensure(arg0).isNotNull()
.otherwise()
.throwThis(
new IllegalStateException())
.now();
//not cool!
www.devoxx.com
27. Mixing method chaining with nested func3ons
ensure(myObject).is(inValidState());
analyse(systemReport).and(notifyByEmail()).ifIsNot(operatingWell());
www.devoxx.com
the solu3on became extensible!
28. Today we saw
DSLs are cool!
External DSLs are hard to implement
Fluent Interfaces and Internal DSLs are the same thing
Fluent Interfaces work great for extensively used APIs
www.devoxx.com
29. That’s all folks!
project hXp://fluval.sourceforge.net
blog hXp://blog.danielgazineu.com
email/gtalk danielgazineu@gmail.com
twiXer @danielgazineu
www.devoxx.com