0

I just finished watching this video of Nicholas Zakas regarding scalable JavaScript Application Architecture (http://www.youtube.com/watch?v=vXjVFPosQHw)
I am working on a project which involves jQuery + (AngularJS or KnockoutJS). We can think of creating abstraction around jQuery such that I can replace jQuery with, say, Dojo according to my client's requirements. But how can we create abstractions around libraries like AngularJS or knockoutJS, so that my application is less prone to huge modifications when I choose or replace either of these libraries.

Thanks for reading.

4

2 回答 2

2

围绕 jQuery 或 Dojo 创建一个抽象是有意义的,因为它们试图完成相同的事情,操作 DOM 或更改 HTML。

但是,Angular 和 Knockout 是客户端框架。每个框架的目标完全不同。因此,围绕它们进行抽象对我来说并没有多大意义。

我会弄清楚你的客户想要什么,仔细挑选符合要求的框架,并坚持下去。

于 2013-10-09T19:05:38.313 回答
2

由于 Angular 的declarativevsimperative特性,库的抽象在视图模板中会很棘手。您不应该将 AngularJS 视为一个库,而应将其视为一个更大的技术堆栈的一部分的框架。

于 2013-10-09T19:07:49.443 回答