silverstripe/sapphire — pull request #382 by chillu (2012-04-30 12:35:11+00:00)
Title: Group default on member (#7217)

See http://open.silverstripe.org/ticket/7217

The setItemRequestClass() API is not strictly required for this feature, but strikes me as something that's frequently used. We can't (easily) use dependency injection for this because of the large amount of context that's required as constructor arguments - most of which are usually not yet available when the configuration happens.

I'd like to see the callback pattern will be a common way to encapsulate per-instance based logic (as opposed to per-class based decorators, and class inheritance). They do lack a bit of structure though, you have to look in the PHPDocs which callback arguments are required. But overall, I think JS has matured quite well with similar restrictions, so don't see this as a big argument against anon functions, right?