Design question for any other Mate users out there. Will cross-post to Mate
forum.

I use Mate with the Manager + Presentation Model pattern.
i.e. presentation model dispatches bubbling events. Mate event map invokes
services calls, sets result on manager. Properties are injected from manager
to presentation model.

I find it very convenient to have a "data status" property in the
presentation model for each service call, with values NOT_CURRENT, LOADING,
LOADED and ERROR. Then the view can display appropriate status and progress
indicators based on this property.

One approach (a) is to have the event map set the status on the manager and
have the map inject that status into the presentation model.

Another (b) is to set the status in the presentation model just before
dispatching the event, and when receiving the result (i.e. in a custom
setter).

I like the directness of (b), but it doesn't cover the error case unless the
manager also has something like a faultevent property that also gets
injected into the presentation model.

A third approach (c) would use listener injectors. The map would inject a
listener into the presentation model and would announce a special failure
event.

Thoughts?

Reply via email to