I'm trying to extend the framework so that you can choose to not use singletons. http://forums.puremvc.org/index.php?topic=235.0
Changing the concrete Facade, Model, View and Controller is no problem, but the Notifying system worries me.
Because a lot of classes (MacroCommand, SimpleCommand, Mediator and Proxy) extend the Notifier class. It's impossible to change it without having to create copies of his subclasses.
I'm thinking about the following options:
- Copy Notifier, make facade changeable (By param in constructor of public property), copy all it's subclass to extend it.
- Copy all subclasses of Notifier and change the facade (less clear I guess)
- Change all the pureMVC classes so that you can give almost every class a reference to the facade. (But this is useless for the normal pureMVC)
- Make this into a alternative version of PureMVC
(Unless one less someone has a better idea this seems the best option, pureMVC just doesn't seem flexible enough)
(I can't make a facade singleton for every sub MVC because this Notifier can only be hooked to one facade. Than we would still need to copy the whole framework for every sub MVC. )
A possible way to make the notifying system in pureMVC more flexible is to use compilation instead of extension to add Notifying capabilities. (Like you can use a custom subclass of EventDispatcher in as3.0)
This way I could extend the notifiers (MacroCommand, SimpleCommand, Mediator and Proxy) and change there notifier via there protected notifier property.
This seems okay, but this involves changing the whole framework, in my opion it's better to change it to a singleton less framework right away.
Do you guys have any ideas?