tag:blogger.com,1999:blog-23881856886969249.post6607452866630467077..comments2024-01-12T16:27:17.222-06:00Comments on Josh (Formerly) In Antarctica: Griffon Action PatternsJosh Reedhttp://www.blogger.com/profile/02066492903706506905noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-23881856886969249.post-15845784309528242652009-07-02T21:10:30.576-05:002009-07-02T21:10:30.576-05:00Thanks for the comment Andres. One advantage that...Thanks for the comment Andres. One advantage that I see to using the actions map approach is you could do auto-binding between your action definition and the implementation. The old convention over configuration. So if when you declared your action, you don't specify a closure, it could attempt to bind to controller.actions[id - 'Action']. It would save one line per action definition, and you could override it by explicitly setting a closure.Josh Reedhttps://www.blogger.com/profile/02066492903706506905noreply@blogger.comtag:blogger.com,1999:blog-23881856886969249.post-86742995059508965052009-07-02T20:47:18.009-05:002009-07-02T20:47:18.009-05:00Hi Josh, glad to see you're back into blogging...Hi Josh, glad to see you're back into blogging, and about Griffon no less :-)<br /><br />Personally I go with the following confventions:<br /><br />1. all actions are of the form 'def actionName = { evt = null -> ...}'<br />2. controller logic is handled by methods like 'void doIt() { ... }'<br />3. methods are usually private<br />4. actions are declared at the top of the file, methods at the bottom<br /><br />Cheers,<br />AndresAndres Almirayhttps://www.blogger.com/profile/10710950259740699258noreply@blogger.com