My favorites | Sign in
Project Logo
                
People details
Project owners:
  glid...@hotmail.com

FakeMVC is essentially a single-core alternative (ie. almost similar replica) of the PureMVC framework. Like PureMVC, it's extremely bare bones, even more so because FakeMVC doesn't even have a Model/View/Controller core, but simply just stores all it's proxies, commands and mediators in a single standalone facade class. In short, you'd rather be using PureMVC. This framework was done mainly because I wanted a working single-core alternative to PureMVC.

Here are the key FakeMVC API differences to PureMVC:

1) Currently, there are no interfaces here, just AbstractProxy, AbstractMediator and AbstractCommand. This is a limitation in itself, and doesn't help in file size since your core actor modules often import the full implementation (of the Abstract classes) rather than just the interface signatures itself. The next time I use this framework (if i do), I'll support it with interfaces, otherwise, you're on your own here.

2) The Facade (known as BaseFacade which you normally extend from) dispatches notifications through Flash's built-in event dispatching system (so the facade extends EventDispatcher). You can directly dispatch such notifications through the facade (which is a singleton, just like PureMVC), and more so directly with dispatchEvent(), so your notifications can (as always) remain context-sensitive and strictly-typed through custom classed events which can be easily documented. Currently, only AbstractMediators listen for such notifications, (not proxies), though it's no stopping you from manually registering/registering listeners to the facade if you so require as such in various contexts.

3) AbstractMediators uses a listFacadeListeners() getter function which returns an array of strictly typed ListenerDefinitions, consisting of the type of event to listen to, the handler and priority which the Facade uses the register/unregister listeners accordingly when the mediator registers and unregisters accordingly. I feel this is an improvement over the original PureMVC because it foregoes the need to keep track of 2 separate function bodies (handleNotification and listNotification), and avoids the redundant (and performance-unwise) switch-case/internal getType() checking in handleNotification, and also allows contextual handling of events beyond the generic and ambigous getBody() methods used in PureMVC's notification system. Also, the ability to set priority is a standard plus over PureMVC's notification system, allowing certain observers to run first. This is obviously more of a Flash-based (and more Flash-friendly) solution, though it could mean having a lot more handler functions to manage. Switch case() can still be done by routing all notifications to the same handler and checking for the event.type accordingly.

4) By default, AbstractMediators do not have a facade reference readily available to them in protected/public namespace. (though you can always force such a reference through BaseFacade.getInstance(), if you so require.)

5) FakeMVC comes with several AbstractMediator extensions like CompositeMediator which allows you to register child mediators so they all get registered/unregistered in one go. Unlike, PureMVC, there's no development like CompositeCommand though.









Hosted by Google Code