Yeah, the cool thing about Swiz, is that this would only add 2 lines of code. 
:-)

-TH

--- In [email protected], Richard Rodseth <rrods...@...> wrote:
>
> Haven't looked at Swiz yet, but as I mentioned, I can certainly announce an
> event in the faultHandler and inject a listener for it in the PM.
> 
> On Fri, Jul 2, 2010 at 3:36 PM, turbo_vb <timh...@...> wrote:
> 
> >
> >
> > I agree, but it can; since the map knows about the PM anyway. This is where
> > Swiz has an advantage with the Mediate metadata. In that case the PM method
> > can just listens for an event; which can be dispatched on fault.
> >
> > -TH
> >
> >
> > --- In [email protected] <flexcoders%40yahoogroups.com>, Richard
> > Rodseth <rrodseth@> wrote:
> > >
> > > The map shouldn't interact with the PM (other than building it with
> > > ObjectBuilder and injecting it into the view).
> > > I'm leaning towards a). That way it's centralized and manager properties
> > can
> > > potentially be injected into multiple presentation models.
> > >
> > >
> > >
> > >
> > > On Fri, Jul 2, 2010 at 1:56 PM, turbo_vb <TimHoff@> wrote:
> > >
> > > >
> > > >
> > > > I usually use (b). For the error, you can call a public method in the
> > PM
> > > > from the faultHandler in the map; as one alternative.
> > > >
> > > >
> > > > --- In [email protected] 
> > > > <flexcoders%40yahoogroups.com><flexcoders%
> > 40yahoogroups.com>, Richard
> >
> > > > Rodseth <rrodseth@> wrote:
> > > > >
> > > > > 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