Skip to content

#cfunited Notes – “CF Developer’s Guide to Mate Flex Framework”

Sample Application

Uses upcoming.org REST API to show events

ColdFusion End

  • basic CFC to call API (getCountryList, getStateList, getEvent, search, etc)

Mate

  • easily handle flex events
  • tag-based
  • dependency injection
  • supports modules
  • flex messaging support
  • extensible (extensions available)

Typical Process

  • view — event –> main.mxml -> eventMap (remote objects to CF) -> manager
  • result is then injected into the view

Terminology

EventMap:

  • EventHandlers
  • RemoteObjectInvoker
  • ResultHandlers
  • MethodInvoker
  • EventAnnouncer
  • Injectors

Manager

Setting up your Flex App

  • Enable CF remoting
  • Include mate.swc
  • Typical folder structure

Mate does not care about how you build your view

  • follow standard flex practices
  • no framework references in the view (exception being dispatcher which does “private” events but this shouldn’t be used unless needed)

Events are Events

  • just regular events
  • dispatched using standard dispatchEvent() method
  • “bubbles = true” will be helpful

EventMap handles Mapping Events

EventHandlers define

  • what the event responds to

Confronting your manager

  • business & app logic
  • bindable properties

Injecting Data

  • keep view independent of framework
  • view has a setter method to update it when event happens
  • injectors are defined with target and then data to pass (propertyInjector, listenerInjector).

Responding to event in the view

- cut off -

References

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*