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

Summary

We started this chapter by trying to explain how important it was to get a good foundation in application architecture in general, and for that reason we had a look at the MVC pattern. We then continued describing how the MVC pattern was somewhat used in Angular, even though it was called MVW, model view whatever. We did this to understand that the Angular framework consists of a lot of constructs that help us organize our application in a way that makes it easy to extend, maintain, and parallelize the work.

Angular brought a lot of new things to it though, such as ES2015 modules, which attempted to solve the problem of how to split up the code in a manageable way. After that, we argued that although ES2015 modules were great, there was a lot of ceremony attached to them when it came to creating complex objects. To help relieve us of that ceremony, we described how Angular Dependency Injection could be the solution to said problem. In reality, you will use ES2015 to import your constructs. What Angular DI helps us with is creating the dependencies needed for our constructs.

Lastly, we tied the knot of explaining the MVC pattern by simply stating that data doesn't really live permanently, in either the model, the controller, or the view, but can be retrieved and persisted by talking to an endpoint, reachable through HTTP. We concluded the chapter by describing how the Angular 4.x HTTP service can help us with just that.

All of this is interesting from an educational standpoint. It doesn't describe the elephant in the room, how do we manage our data when things gets complicated? The concerns we have to deal with are:

  • Bidirectional data flow
  • Lack of predictability (a change can lead to cascading changes)
  • Spread out state (there is no one source of truth and our components can sit on a state that is partially updated)

Let's keep these concerns in mind as we move on to Chapter 2, 1.21 Gigawatt – The Flux Pattern Explained.

主站蜘蛛池模板: 扶绥县| 綦江县| 邢台县| 桑植县| 北碚区| 临颍县| 依兰县| 长治市| 秦安县| 祁阳县| 东乌| 色达县| 贡嘎县| 神农架林区| 张家界市| 铜山县| 华池县| 贺兰县| 鲁山县| 曲松县| 阿荣旗| 揭阳市| 马尔康县| 家居| 丹巴县| 馆陶县| 洪洞县| 胶州市| 徐闻县| 商洛市| 历史| 高邑县| 马关县| 金塔县| 呈贡县| 化隆| 五常市| 买车| 本溪| 石渠县| 漳州市|