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

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
主站蜘蛛池模板: 英超| 射洪县| 都安| 荆州市| 岳池县| 荥阳市| 阿拉善盟| 金湖县| 靖西县| 太和县| 泗阳县| 桓台县| 连江县| 江阴市| 金秀| 宜州市| 都昌县| 昌江| 库伦旗| 临澧县| 海城市| 凤台县| 四川省| 武宣县| 江都市| 陇西县| 青海省| 铅山县| 衡阳市| 江陵县| 旌德县| 柏乡县| 博野县| 温宿县| 微山县| 永济市| 鹤庆县| 安陆市| 开原市| 同德县| 丽水市|