Hi,

I'll let the DDD experts suggest proper solution but to me Person#delete()
(i.e. a person domain object deletes itself) looks strange.
Usually the repository deals with these matters.
I'd expect to go back to the listing with the other domain objects from
this type after the deletion.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, Dec 19, 2015 at 12:43 PM, Y.R Tan <[email protected]> wrote:

> Hi everyone,
>
> When using a void action, let’s say a remove action, the user is
> redirected to a page "no results". When clicking the back button in the
> browser the user sees "Object not found" (since you’ve just deleted this
> object).
>
> Example:
>
> public class Person {
>     ....
>     public void remove() {
>         ...
>     }
> }
>
> You can return a list for example to prevent the user from being redirect
> to a "No results" page, but I think it’s not the responsibility of the
> controllers in the domain model. A solution could be that wicket viewer
> goes back one page when encountering a deleted object. And refresh the
> current page when receiving a null response or invoking a void action.
>
> What do you guys think that is the best solution? Or do you have another
> view on this situation?
>
> Looking forward hearing from you.
>
> Regards,
>
> Yu Ri Tan

Reply via email to