From: Gregg B. <gdb...@gm...> - 2008-01-25 00:14:17
|
You can always annotate with @HandlesEvent and then you don't have to define the return type. Gregg On Jan 6, 2008 5:59 PM, VANKEISBELCK Remi <re...@rv...> wrote: > Hi, > > Yeah you can't write : > > def blah() { > return new ForwardResolution() { > } > } > > because Stripes uses reflect for finding events : an event method > *has* to return a Resolution. > When you dojn't declare the return type (using "def") then it can be > anything... When you use reflection on that I guess what the > java.lang.reflect.Method's return type is Object. > > > Remi, the only one I didn't do at this time was the closure for > > wrapping redirects. You'd have to explain a bit more how that would > > really help. > > It's only more concise, it avoids repeating the calls to constructors > etc. But thinking about it, it might not be worth it, as the code > reads fine like this. > > > (I left the () after void method calls, though, just my personal > > preference that I still like) > > Yeah, I usually use the parenthesis as well... it can be harder to > read and understand without them sometimes, it's not my preferred > feature. It's cool for small DSLs though. > > Cheers > > Remi > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Stripes-users mailing list > Str...@li... > https://lists.sourceforge.net/lists/listinfo/stripes-users > |