官术网_书友最值得收藏!

  • Mastering Backbone.js
  • Abiee Echamea
  • 201字
  • 2021-07-23 14:39:33

Chapter 2. Managing Views

As we have seen in the previous chapter, Backbone views are responsible for managing DOM (Document Object Model) interactions between users and applications. A typical Backbone application is composed of many views with a very specific behavior; for instance, we can have a view to show contact data and another view to edit it. As you know, rendering a single view is a trivial task, but orchestrating a complex layout with multiple views can be a pain.

It's important to develop a better strategy to deal with complex view interactions to make the project easier to maintain and fun to develop. If you don't put the necessary attention into the organization of your views you can end up with a dirty DOM and messy code, which makes it hard to introduce new features or change existing ones.

As we did in the previous chapter, we are going to separate responsibilities by identifying common view use cases and then will learn how to compose layouts by using small views.

In this chapter you will learn to:

  • Identify common view types
  • Implement reusable views for common types
  • Use the reusable view types to compose complex views easily
主站蜘蛛池模板: 萨嘎县| 万盛区| 渭南市| 榆中县| 达州市| 泉州市| 元江| 望江县| 年辖:市辖区| 玉门市| 望都县| 合江县| 中卫市| 山东| 星座| 江孜县| 宜川县| 彰化市| 武威市| 永昌县| 苗栗县| 乌兰察布市| 安平县| 崇信县| 武定县| 临桂县| 汤原县| 于田县| 焦作市| 庄浪县| 资兴市| 台南县| 奇台县| 诸城市| 宣汉县| 贡嘎县| 丹凤县| 扶绥县| 申扎县| 宁波市| 永吉县|