Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: 1 2 3 [4]
46  Announcements and General Discussion / Getting Started / Stage resizing on: July 06, 2009, 04:21:06
Hi

I am building an application that needs to run "fullscreen" (as in fullscreen within the browser, not a "take over"). When the window is resized the different elements obviously needs to reposition.

For this I use at StageMediator, whose viewComponents is stage. The StageMediator listens for the RESIZE event and sends a ApplicationFacade.STAGE_RESIZED notification.

Every other mediator that controls a view component that needs to reposition naturally listens for this notification.

Heres my concern, should the repositioning logic be in the view component or in the mediator? It seems that if I put it in the component it breaks some of the reuseability as you cannot assume that a component needs these things?
If I put it in the meditors the begin to more than merely mediate, which seems to break best practice?

Does it make sense?

Regards
47  Announcements and General Discussion / Getting Started / Re: Is my approach somewhat correct? on: June 29, 2009, 06:21:10
Thank you very much :)
48  Announcements and General Discussion / Getting Started / Re: Flash, passing stage to ApplicationFacade on: June 29, 2009, 06:19:36
Great thanks :)
49  Announcements and General Discussion / Getting Started / Flash, passing stage to ApplicationFacade on: June 29, 2009, 12:50:57
In the various Flash examples I've seen using PureMVC the object sent to the application façade startup is the stage, why is this?

In some applications you don’t really need stage, and if you did, stage could always be reached through the document class instance.

So I just pass the document class instance to the application façade, is this considered bad practice, or will it have some side effects I've missed?

Regards
50  Announcements and General Discussion / Getting Started / Is my approach somewhat correct? on: June 29, 2009, 12:15:44
Hi All
I'm trying to get my head around PureMVC. I am doing it by refactoring a really simple app I've done. So I thought I would ask here if my initial approach is somewhat correct, or if I am misunderstanding certain concepts?

The app is a searchable gallery of products.

The product data is loaded from a server, and the images are also dynamically loaded.

The user can enter various criteria and the gallery is then updated to display only the products that fit the criteria.

The user can then click a product image to get more information on that product.

Thats it.

So I have 3 view components;
UserSelectionUI (containing various buttons, a combobox and a search field)
GalleryView
ProductDisplayView
(and maybe an AlertView for error messages)

These view components gets a Mediator each.

I have two proxies;
ProductProxy (which loads the xml and stores the product list)
ParamsProxy (for flashvars)

The ProductProxy is initiated from a StartUp Command, when the xml is loaded it is parsed into a list of ProductVO objects, which the proxy now stores. It then sends a notification that the data is ready.
I am in doubt as to where I should put the filtering function that find product matches based on user input. Should it be in a Command or in the Proxy, or even in the UserSelectionUIMediator?
Right now I’ve implemented the filtering function in a Command (SearchCommand). The notification for the search contains a SearchVO containing all the search settings (the properties the user has selected).

But this means that the view component (UserSelectionUI) needs to populate the SearchVO and pass that to the mediator who then ships it with a notification to the Command. That’s a lot of shared knowledge isn’t it?

The Command needs to compare the result list with the previous result list to prevent an unnecessary update of the view. Since Commands holds no state information I’m storing the previous result list in the ProductProxy, is that ok?

Are VO’s part of the model controller or view?

Hope this makes sense?

Regards
Pages: 1 2 3 [4]