I have an architectural question. I've introduced
EntityWorkflow to my
Activities & Places enabled app. In GWT's
Activities & Places there are the
Presenter interfaces which is used by a view to delegate the implementation of certain action (like edit() & save()) to the
Activities class. So does it make sense to treat an
EntityWorkflow as a A&P view and to apply A&P's action delegation feature here? Or to speak code-wise:
public class EntityEditorWorkflow {
// Empty interface declaration, similar to UiBinder
interface Driver extends RequestFactoryEditorDriver<EmployeeProxy, EmployeeEditor> {
}
private static final Driver driver = GWT.create(Driver.class);
@UiHandler("save")
public void onSave(ClickEvent event) {
// implementing the actual SaveEntity code
Person edited = driver.flush();
if (driver.hasErrors()) {
// A sub-editor reported errors
}
doSomethingWithEditedPerson(edited);
vs.
// ...
presenter.save(entity);
}
}