Modal queue/manager in RL

ryan.hunt's Avatar

ryan.hunt

01 Aug, 2011 10:15 PM

First off, I'd like to thank everyone in the community for providing such excellent discussion for me to learn from. This is the first question I've posted, since I've just been lurking up until now.

So... the RL system I'm working in has a fairly elaborate modal queuing system, where Views are being passed to a ModalManager via Signal. Each modal type has a Mediator its paired with so that it can communicate out to the system at large. The ModalManager also taps a ModalModel for state and other info.

Right now, the problem is (or I think its a problem) that I need to populate the modal with data from models so I have to set a public id value on the View that its Mediator grabs in order to fetch the data from the model. This seem like bad practice in RL.

Is there are better way of doing this? How are others generating data rich modals in RL?

Thanks...

  1. Support Staff 1 Posted by Ondina D.F. on 02 Aug, 2011 09:25 AM

    Ondina D.F.'s Avatar

    Hi Ryan,

    Right now, the problem is (or I think its a problem) that I need to populate the modal with data from models so I have to set a public id value on the View that its Mediator grabs in order to fetch the data from the model. This seem like bad practice in RL.

    My first thought was, why would it be a bad practice to have getters/setters inside the view? In my opinion it’s not bad practice. Opinions may differ :)

    Like this:
    View

    
    protected var _viewId:String;
    public function get viewId():String
    {
        return _viewId;
    }
    public function set viewId(value:String):void
    {
        _viewId=value;
    }
    
    

    Mediator

    doSomethingWithThe(view.viewId);

    That’s in case you were talking about the views’ ID, that a mediator would need. Maybe you were using getters already, so if I missed your point, more details about your app would be helpful.
    Or were you talking about the communication between Mediators and Models, and the best way to fetch data from a model?

    I just wanted to get the discussion started, and I hope someone else will take over from here :)

    Ondina

  2. 2 Posted by ryan.hunt on 02 Aug, 2011 04:22 PM

    ryan.hunt's Avatar

    Yeah, that's pretty much how I'm doing it. I pass an id to the view constructor that the mediator fetches once its added to the stage. Then the mediator uses that to retrieve the data it needs from the model(s).
    I don't know why I thought this was bad. It just feels sloppy for some reason.

  3. Ondina D.F. closed this discussion on 01 Nov, 2011 11:41 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac