Thanks Rossen, I like your proposed plan.
While it would add a significant degree of complexity & sophistication internally, at the API level this should provide an “it just works” intuitive extension of the present mechanism. Since the JDK 7 reflection changes, this is really required for non-trivial use of @ModelAttribute to be useful.
My main concern really is diagnosability – that the selection & ordering of methods can be logged effectively for debugging.
With regard to @ModelAttribute methods for supplemental rendering of the Model after request-handling – this "kind of" makes sense as an extension of existing semantics, but I definitely miss having a clear distinction between “referenceData”() before the handler-method, and “renderModel()” after the handler-method. These are completely different phases of the request-handling lifecycle!
I am not sure exactly what the best answer is, in this case. But I feel that making pre & post phases of the handler-method into "all the same annotation" & automagically ordering them by dependency graph, may not help developer understanding as to there being an actual & very concrete lifecycle. I don't like whitewash
Keep up the great work & I am eager to see the results!