I have just started with backbone... I was excited about it until I ran into a something quite confusing. So with what I have seen while searching for backbone info is that a view is basically unique to one element.
Example project: Web page builder / editor
So reguarding the example project I am guessing that you will have a view Element()
with methods that would do some of the following
and in those methods they would do something like
this.el.style.color = 'red';
The only way I thought for this to be possible is to create a new Element({el: someElement})
for each element that is being changed.
So say you have 100+ elements on a page and 100+ views, that just wouldn't seem right to me.
If the questions confusing that's because I'm Confused so if you need any more info. comment...
Also I can't seem to work out where Models would come into a application like this because most of the info I have read about them is that they are used to contact the server, whereas in this case. that would only be when the page is saved.
So, is it Normal to have so many views?
In my experience, the short answer is yes, that is fairly normal.
Generally in the sophisticated web applications in Backbone I have seen, it is certainly fairly common to have a few dozen views in the viewport. For example, a handful of views for the header, navigation, footer, and then maybe showing a dozen or so models, but each model is represented by a handful of views.
@mu's comment makes a good point that at some point maybe you need to just simplify your application's UI. But yes, if you are working on some sort of WYSIWYG style live web page editor, expect the order of magnitude of live view instances in the hundreds.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With