Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
October 23, 2017, 06:16:10 AM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Print
Author Topic: Mediator constructor  (Read 3827 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



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

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:
Code:
        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
Jump to: