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 3 [4] 5 6 ... 10
|
53
|
Announcements and General Discussion / Getting Started / Re: Where is the best place to declare a global variable
|
on: November 06, 2008, 02:03:37
|
Thanks, really apreciate.
One more doubt on this. Is it okey to declare global variable in ApplicationFacade and get the data through proxy and use facade to get the global variable.
ApplicationFacade
{ public var myGlobalVariable;
ApplicationFacade( ){ var myProxy:MyProxy = facade.retriveProxy(MyProxy.NAME) as MyProxy; myGlobalVariable = myProxy.retrieveGlobalVariables(); } } | [/color] and then access the global variable using facade
Thanks, Mansoor
There is 100% no reason to do this as any mediator, command, or proxy can access the proxy by calling facade.retrieveProxy(MyProxy.NAME) I recommend removing 'global variable' from your vocabulary in terms of PureMVC applications.
|
|
|
57
|
Announcements and General Discussion / General Discussion / Re: How to handle multiple views of the same type?
|
on: October 20, 2008, 03:16:21
|
Thanks for the feedback! I took the same road like Joel proposed (after making sure the mediator name is unique through createUID). I don't understand however that (Pure)MVC doesn't have support for something essential like this out of the box
My guess is that the framework is supposed to be 'as simple as possible, but no simpler' and this sort of solution is one that will vary from project to project. Using the Notification body and/or type parameters is effective for this sort of thing, so really it does support it out of box. If you have a good way to plumb something up, you might consider writing a utility to do so. I'd love to check it out. I'm running through solutions in my head, but I get stuck at the way I've always done it (as described in my other post). Cheers
|
|
|
60
|
Announcements and General Discussion / Architecture / Re: Multiple instances of the same mediator/proxy?
|
on: October 17, 2008, 06:27:30
|
Thanks for the reply. I got the idea of unique id + NAME. What about the notification then? To my understanding, the current notification mechanism of puremvc is at "class" level, instead of instance level. Any good idea to make it work at instance level?
case NotificationSender.IMPORTANT_NOTIFICATION: if(notification.getBody().uniqueIdentifier == this.aValueObject.uniqueProperty) { doStuff(); } So notifications are declared at the class level, but you can check against your instance to see if it needs to react.
|
|
|
|
|
|