IoC Container
Comments
The Prototype functionality does not seem very useful to me in the framework construct. What would be useful is if each view can be tied to a specific instance of an instantiated controller. Since the views will respond to any one of the controllers dispatching an event, it is not possible to have separate instances of the same views. For example if I had picture viewers, and separate controllers to load pictures. When each controller fired off an even that it found a picture, the independent views would respond to events from both controllers, which would not be useful.
I don't see any way that what you're asking for is possible, given the way events work in Flash. If the same event is being handled in multiple views, Swiz can't set up an event handler that "knows" you only want one view to respond, or which view that should be. Further, since it is often the case where you WANT an event to be handled by multiple views or beans, there is no way to tell the difference between events that you want handled in all associated EventHandler methods, vs. events that you want handled by only one.
In other words, it's not a Swiz issue, it depends on your own decisions. You could inject the controller prototype into a view, and then when the controller dispatches an event, include a reference to the controller that each view can use to see if "its" controller matches the one that dispatched the event, and only handle the event if it is a match. You'd have to do something like this even if you weren't using Swiz at all.
If you want a longer discussion, please post to the mailing list so that the community can participate.
I'm new to this framework (and to frameworks in general) - using your swiz_quickstart as an example, would I also register the UserService class as well? or is this specifically for model/controller classes only?
The Quickstart example does specify the UserService as a bean. So yes, any non-UI classes that you want Swiz to process need to be declared as Beans. They can really be anything (except UI components, which are processed when they are added to the stage). So that generally means services, controllers, models, and any utility or helper classes that contain Swiz metadata. Make sense?
Im BeanProvider muss auch der XML-Namespace für MXML angegeben werden, sonst beschwert sich bei mir der Compiler im FlashBuilder.
( xmlns:fx="http://ns.adobe.com/mxml/2009" fehlt )