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
|
Pages: [1] 2
|
1
|
Announcements and General Discussion / Getting Started / Re: AppSkeleton not conform FAQ?
|
on: November 10, 2008, 06:33:16
|
Hi jerry, good catch! I will commit the fixed version in the next days.
@Cliff: About the use of constant in Proxy we have to stick the FAQ, but I found usefull to define the notification constants in the proxy for a couple of reason:
- if the proxy can used in more projects, I have to move less files, in the case of ConfigProxy I must to move only this file. Otherwise if I have more proxies that are reused in differents projects, for each proxy I have 2 classes: one for the proxy and one for the constants.
- if the notification is send only from proxy and the other tiers listen it, I found convenience to define in the proxy this will help me to understand the notification role, if is defined in ConfigProxy I know that is something about Config. I found it usefull when I work in a team.
Best Daniele
|
|
|
3
|
Announcements and General Discussion / General Discussion / Re: first project with pureMVC
|
on: January 28, 2008, 03:10:29
|
Hi Philip, thank for the suggestion, we look on it in depth.
For now I can say that I already have a similar implementation that is in the demo repository that Cliff will release soon.
In StartupMonitorProxy there is the addReesource method that have blockChain parameter
public function addResource( proxyName:String, blockChain:Boolean = false ):void { this.resourceList.push( new ResourceVO( proxyName, blockChain ) ); }
Your implementation is interesting because you can specify the the resources dependancy.
|
|
|
5
|
Announcements and General Discussion / Architecture / Reset and delete a view
|
on: November 30, 2007, 06:11:26
|
Hi all, I just finish a big project build with Flex and PureMVC, and I'm very happy but I have to optimize a bit.
The project contains about ten views in the main ViewStack, the creationPolicy of viewStage is set to auto. With this settings the first time that the view is showed, Flex create all needed components, When the user change view, the old view is hidden and the new showed, but the old still live. In some cases this is a advantage, because when the user come back to the view the state of all components are the same (ie. a list selection). But there are cases that this is not a good thing, in my scenario after that the user use a application for some time the memory usage increase, because all views are created and there is not a garbage collection. And I need also that each time a enter in the view all components are resetted.
I just thinking how to solve this situation and I have had this ideas:
Create a component that listen the change event of ViewStack. When the component is showed create the mediator and the view. When the component is hidden remove the mediator and the view from the displayList
example: <mx:ViewStack id="vwStack" left="0" top="0" right="0" bottom="0" resizeToContent="false" creationPolicy="auto"> <viewHelper mediatorClass="myMediatorClass"> <myRealView /> <viewHelper> </mx:ViewStack>
Other little advantage of this solution is that you don't need to create all views mediators inside ApplicationMediator.
Someone have other (more elegant) solutions?
Best Daniele
|
|
|
7
|
Announcements and General Discussion / General Discussion / Re: Popup Window
|
on: November 12, 2007, 11:42:07
|
Hi Cliff, I have a little question, if a have a button that open a popupWindow, what's the best way to do it?
- the Component dispatchEvent - the Mediator capture the event and sendNotification for execute the Command - the Command call the PopupManger for open the popupWindow (with the PopupManger is only one line of code).
or
- the Component dispatchEvent - the Mediator capture the event and call the PopupManger for open the popupWindow
or
- the Component call the PopupManger for open the popupWindow
|
|
|
10
|
Announcements and General Discussion / General Discussion / Popup Window
|
on: November 05, 2007, 04:45:02
|
Hi all, I want to share with you a little code that have found usefull in the project that I just build with PureMVC. A lot of time I must to open different popup windows each with own Component/Mediator, I have written this code inside ApplicationFacade:
import flash.display.Sprite; import mx.core.Application import mx.core.IFlexDisplayObject; import mx.managers.PopUpManager;
public static function openPopUpWindow( ComponentClass:Class, MediatorClass:Class ):void { var window:IFlexDisplayObject = PopUpManager.createPopUp( Application.application as Sprite, ComponentClass, true );
ApplicationFacade.getInstance().registerMediator( new MediatorClass( window ) ); PopUpManager.centerPopUp( window ); }
public static function closePopUpWindow( window:IFlexDisplayObject, mediatorName:String ):void { PopUpManager.removePopUp( window ); ApplicationFacade.getInstance().removeMediator( mediatorName ); }
For open the window you have to call ApplicationFacade.openPopUpWindow( MyComponent, MyComponentMediator ); and for close the window: ApplicationFacade.closePopUpWindow( myComponentInstance, MyComponentMediator.NAME );
Best, Daniele
|
|
|
11
|
Announcements and General Discussion / General Discussion / Re: first project with pureMVC
|
on: November 05, 2007, 04:26:37
|
Hi meekgeek, your suggestion is very cool and I have modify my ApplicationSkeloton code, the new version can be downloaded here: http://dev.ugoletti.com/puremvc/ApplicationSkeleton_v1.3.zipI have based the new version to your code but with few differences: - I have add a parameter to addResource function, because some resources can be loaded before others, ie in my example the config.xml must be read before the other resources. - I have used a Array insteed a Dictionary becase during the iteration the keys are in different order how are created I just created this...
I thought this might be a little more reusable then counting.
If someone can advise if it's complying to best practice I'd like to contribute something to this post. 
......
It's the first proxy to be registered. All other proxies that need to be loaded before moving on, will call addResource() which adds them to a list of resources. Once all proxies have been added, you execute a command to call loadResources() which calls load() on all proxies in the list. Once the individual proxies complete the load process, they call resourceComplete() to advise StartupMonitorProxy that something has finished loading. It then checks to see if all proxies are ready. If all proxies check out, it notifies the framework to move on 
If this is looking like something that other's can use I can upload the files I'm using.
|
|
|
12
|
Announcements and General Discussion / General Discussion / Re: first project with pureMVC
|
on: November 05, 2007, 02:34:04
|
Yeah, I see that, but in the code, ApplicationFacade calls ApplicationStartupCommand which add two sub commands, ModelPrepCommand and ViewPrepCommand. I can't find where StartupMonitorCommand is used. Am I downloading a different zip?
Sorry if I'm missing something right in front of my face. I'm new to this framework. Heard this was better than cairngorm 
Hi meekgeek, the file StartupMonitorCommand isn't used, you can delete it, sorry but I forgot to delete before post the zip  Daniele
|
|
|
|
|
|