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: Mediator constructor  (Read 7271 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« on: December 12, 2007, 02:04:54 »

Hey folks.

First, have a look at this post:

http://forums.puremvc.org/index.php?action=post;topic=147.0;num_replies=0

You've probably noticed the asymmetry between the constructors of the Mediator and the Proxy. It's annoying, yes. Has it come up before? Yes. Have I dragged my feet on it? Yes.

It's lamentable I didn't just change it early on. But now that we're about to present this framework to the rest of the world, lets polish it. The AS3 folks will get over having to do a refactor, but they'll privately rejoice that it'll be far better going forward.

As I mention in the post, I'm going to get this 1.7 removeMediator fix out the door first, it requires no refactoring.

Then, when I check the AS3 version into the public repository, it'll be refactored to org.puremvc.as3.*, and its Mediator constructor will take name followed by view component.

Please go ahead and refactor your own code to do this. I expect the AS3 code to look like this:
:
        public static const NAME:String = 'Mediator';
       
        /**
         * Constructor.
         */
        public function Mediator( mediatorName:String=null, viewComponent:Object=null ) {
            this.mediatorName = (mediatorName != null)?mediatorName:NAME;
            this.viewComponent = viewComponent;   
        }

...

        // the proxy name
        protected var mediatorName:String;


-=Cliff>
Logged
Pages: [1]
Print