Best practise way using this framework to bind aspects of the model the view

Nikos 's Avatar

Nikos

Jul 09, 2010 @ 09:13 AM

I've had a look at the updated version of the simple stock price example but fail to see the benifits of it. for example I don't see a best practise way using this framework to bind aspects of the model to componts in the view(therefore having to update the components manually)

  1. Support Staff 1 Posted by Shaun Smith on Jul 09, 2010 @ 02:17 PM

    Shaun Smith's Avatar

    I'm not sure which "simple stock price" example you're referring to. Nevertheless, directly binding views to your models is the kind of tight coupling that a shared event dispatcher is designed to prevent. That said, you're welcome to design your apps however you see fit - for example, favoring "tight-coupling and convenience" over "loose-coupling and slightly more code".

  2. 2 Posted by Nikos on Jul 09, 2010 @ 02:49 PM

    Nikos 's Avatar

    hmm, i apologise for my noob question lol.

    Do you see it fit to create local variabes in your views then and bind to them in the components?

  3. Support Staff 3 Posted by Shaun Smith on Jul 09, 2010 @ 03:39 PM

    Shaun Smith's Avatar

    Haha, no problem!

    My view components typically expose an API (public methods and/or properties), and my mediators are responsible for translating application events/properties into a format that the view can accept. Whether those view components bind to those values (internally) or not depends on the case at hand.

  4. 4 Posted by Nikos on Jul 10, 2010 @ 01:23 PM

    Nikos 's Avatar

    thanks Shaun , your a star :)

  5. Nikos closed this discussion on Jul 10, 2010 @ 01:23 PM.

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