Hi everyone,
My first post and first attempt to use PureMVC for a project! I went through the documentation and some tutorial sites to get a gist of the framework. I understand a view has its own mediator to interact with the rest of the application.
However, I am having some doubts when it comes to views nested within views (multi-views in a view?). I am building a sort of a shopping cart and the view components used are nested in each other. The main movieclip (shopping cart movieclip) that I will add dynamically has a few movieclips nested in it (details window, order list etc) and this is where I am unclear about the mediator and its view.
Here is my current structure:
ApplicationFacade
controller
- StartupCommand
model
- DataProxy
view
- ShoppingCartMediator
- OrderListMediator
- ThumbnailsMediator
- DetailsWindowMediator
- ApplicationMediator
components
- Thumbnails
- DetailsWindow
- ShoppingCart
- OrderList
ShoppingCart component is the main component while the rest are all nested into it. I registered all nested components mediator in ShoppingCartMediator. Is this right?
So basically here how's I set it up:
-Main document class creates concrete facade (ApplicationFacade.getInstance())
-ApplicationFacade sends STARTUP notification
-StartupCommand tells facade to register ApplicationMediator, register DataProxy
-DataProxy sends notification that it has completed retrieval of data
-ApplicationMediator listens for this and handle notification by initializing the shop
-During this initializing the facade registers ShoppingCartMediator
-In ShoppingCartMediator constructor, I then register the rest of nested components mediator
Up to this far, I am creating mediators only for views that change often or are affected by the model. Am I on the right track here?
By the way, I am using CS3.
Thanks!
P.S. Sorry if I overlooked already existing topics on this issue.
Regards,
darnpunk