Best practise way using this framework to bind aspects of the model the view
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)
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
Support Staff 1 Posted by Shaun Smith on Jul 09, 2010 @ 02:17 PM
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 Posted by Nikos on Jul 09, 2010 @ 02:49 PM
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?
Support Staff 3 Posted by Shaun Smith on Jul 09, 2010 @ 03:39 PM
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 Posted by Nikos on Jul 10, 2010 @ 01:23 PM
thanks Shaun , your a star :)
Nikos closed this discussion on Jul 10, 2010 @ 01:23 PM.