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

Pages: [1]
Print
Author Topic: retrieveMediator / retrieveProxy  (Read 13126 times)
jowie
Jr. Member
**
Posts: 19


View Profile Email
« on: March 28, 2008, 10:32:34 »

Hi there,

Are there any plans to streamline retrieveMediator and retrieveProxy? Or perhaps it's just not possible? There are two "niggles":

1. The whole thing has to be typed at the end, which is a bit of a mouthful on every line
2. In 2.0 you cannot use the constant Proxy.NAME or Mediator.NAME because names are now variable, so where to store a constant relating to the name... In the ApplicationFacade?

I'm just rambling, but if anyone has any input or ideas here I'd be interested in hearing them!

cheers  ;D

:-Joe
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: April 06, 2008, 08:07:05 »

Hi Joe,

I don't really understand your questions, but I'll take a stab at it.

There's no plan to rename the methods. There's no problem defining a public static const in Proxy or Mediator. The defaults in the base classes just ensure that there is a non-null value used if you don't supply one. You should always define NAME in the Mediator or the Proxy if you need to refer to it and it is a single-instance proxy or mediator. See for example the Proxies and Mediators of the EmployeeAdmin Flex demo. If you need dynamically named Proxies or Mediators refer to the HelloFlashMediator in the HelloFlash demo for an example.

-=Cliff>
Logged
justSteve
Courseware Beta
Sr. Member
***
Posts: 55


View Profile Email
« Reply #2 on: April 06, 2008, 04:40:04 »

If you need dynamically named Proxies or Mediators refer to the HelloFlashMediator in the HelloFlash demo for an example.

-=Cliff>

Is that the HelloSpriteMediator?

As an aside....I've noticed a number of places where a 'private var foo:bar' closes out a class - after all the methods instead of the more typical location at the beginning. Just happenstance, or does it indicate anything in particular?

thx
--steve...
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: April 07, 2008, 12:57:42 »

Sorry, yes, that's HelloSpriteMediator.

And the practice of pushing private or protected vars and methods to the bottom of the class is a practice I picked up years ago in Java. The idea is that when someone other than the author opens up a class and starts reading through it, they're usually interested in the public members. You want to know how a method that you're calling is going to behave or what props you can set. The black box members are less important to the casual reader. It's kind of like covering up your private parts with a fig leaf ( pun definitely intended ) :)

-=Cliff>
« Last Edit: April 07, 2008, 12:59:43 by puremvc » Logged
Pages: [1]
Print