CF.Objective Notes -- Getting closure on Closures

July 06, 2012

(Mark's talk was great! This was yet another case where I was too busy listening and reading his code samples to make lots of notes. Mark has posted his slide deck on his blog -- I'd recommend taking a look at that as well.)

Works kind of like an envelope
-- I'm going to pass this to you, can you open it up and read what's inside for me?
-- we can pass it back/forth, do stuff with it

has access to both contexts -- its context, and the calling context
different than "other" situations with cfcoponents

(look up more info on currying)

can make copies of functions that are "bound" to a particular set of data, and save that variation of a function to a variable for later use

Visitor Object
ArrayEach()
StructEach()
-- both are essential the Visitor Pattern

Can use to build data structures in a tree structure form
note in an html document
anything with a parent/child hierarchy

the Tuscan Builder example in Mark's slide deck -- great simple code example of this

XML Builder class...taking it 1 step further, real world example

eachParrallel() -- really easy sample of how to do parallel processing with closures

other possibilities...
minParallel()
maxParallel()
lots of others

Sesame Library on github

learn more -- groovy, ruby, javascript