Warum sollte grails-Aktionen deklariert werden, da die Methoden anstelle von Schließungen und was macht es für einen Unterschied?

In grails 2.0 was ist neu http://grails.org/doc/2.0.0.RC1/guide/introduction.html#whatsNew
es sagt:

1.1.3 Web Features
Controller Actions as Methods
It is now possible to define controller actions as methods instead of using closures as in previous versions of Grails. In fact this is now the preferred way of expressing an action.

Beispiel:

//action as a method
def index() {
}
//action as a closure
def index = {

}

Warum ist das wichtig? Was macht es für einen Unterschied?

UPDATE: ich fand diese Diskussion, dass die Gespräche viel über Umfang und einige ziemlich haarige Sachen. http://grails.1312388.n4.nabble.com/Controller-actions-methods-or-closures-was-Re-grails-dev-Statically-typed-meta-programing-td3048287.html

Ich denke, meine Frage könnte auch dies sein: welche Vorteile bringt-Verschlüsse sind für die Aktionen?

InformationsquelleAutor Mikey | 2012-02-09
Schreibe einen Kommentar