0

In my simple page, I have 3 portions (tittle, paragraphs, links - image attached ) is it all 3 portions need to have a separate model for each of them..?

or i can make a single model for all of them.. which is correct way...

Again, in case in my page, if there is no.of dynamic content which is not have a user interactions, all that contents need a models..? (example: paragraphs)

In a page, there is no.of stuff for just display purpose - still that made by dynamic, and no.of stuff for user interactions, how to decide, whaterall should have the models, and whater should not..?

any one give me clear advice to make a simple page with backbone - mixing, display just a dynamic content and intractable dynamic contents which has?

here is the sample page attached with sample models.

var modelTittle = Backbone.Model.extend({
    defaults:{
        tittle:"set a tittle"
    }
})

var modelPara = Backbone.Model.extend({
    defaults:{
        text:"text yet to be set"
    }
})

var modelLinks = Backbone.Model.extend({

    defautls:{
        link : "link need to be here"
    }

})

enter image description here

3gwebtrain
  • 14,640
  • 25
  • 121
  • 247

1 Answers1

1

No, If you are not expecting any dynamic change in data, there is not use of creating models. In your case I think Paragraphs etc should be in templates rather models as you mentioned there will be no dynamic changes.

thecodejack
  • 12,689
  • 10
  • 44
  • 59
  • In case if i am getting all my page content from url then how to mange that? should i use 2 way of creating a single page, what would be the best way? – 3gwebtrain Aug 29 '13 at 06:38
  • it depends on the type of content you are getting..if you are asking about the paragraphs, then you can always append themn directly to the view using `view.$el.append()` – thecodejack Aug 29 '13 at 06:45
  • so, only we need to consider when we use the "CURD" - is it? – 3gwebtrain Aug 29 '13 at 06:48
  • no...not just CRUD operations...models are basically have data of a web App...not text – thecodejack Aug 29 '13 at 06:51
  • i suggest you to go thgh this link...will detail a lot about MVC..http://coding.smashingmagazine.com/2012/07/27/journey-through-the-javascript-mvc-jungle/ – thecodejack Aug 29 '13 at 06:51