> Instead of returning a Result object, we can also
> consider calling out to a
> result method. This is how Rails works. For example:
>
> class FooAction ... {
>
> Foo foo = new Foo(); // populated from request
> parameters.
> public void create() {
> if (foo.isValid())
> redirectTo("ListFoos");
> else
> chainTo("NewFoo");
> ...
> }
>
> These methods could be inherited from a base class,
> statically imported, or
> something else.
>
What happened to not coupling code to the framework?
> If you like annotations, we should also consider
> abstract methods which
> could be implemented by Struts at run time:
>
> class FooAction ... {
>
> Foo foo = new Foo(); // populated from request
> parameters.
> public void create() {
> if (foo.isValid())
> listFoos();
> else
> newFoo();
> @Redirect("ListFoos")
> abstract void listFoos();
> @Chain("NewFoo")
> abstract void newFoo();
> ...
>
> This doesn't require inheritance and it's still easy
> to unit test with
> EasyMock.
>
> Bob
>
Oh please no... please no abstract methods with magic implementations. What
happens when you go to debug the class?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=38338&messageID=75778#75778
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]