分享
 
 
 

Relevance Reviews #2: Ajax Hacks

王朝other·作者佚名  2006-04-16
窄屏简体版  字體: |||超大  

URL: http://blogs.relevancellc.com/articles/2006/04/09/relevance-reviews-2-ajax-hacks

This week, I am off to Vancouver to teach Ruby on Rails Today's in-plane reading is Bruce Perry's Ajax Hacks, published by O'Reilly.

Quick summary:Chapters 4 and 9 are excellent and may justify buying. Skip the rest.

The "hacks" format breaks the content of a technical book into (in this case 80) individual entries. As I mentioned in an earlier review, I like this format because like most developers I learn best by example.

Unfortunately, the "hacks" metaphor breaks down in this book. Chapters 1-3 are not really hacks at all; they are mostly a raw-JavaScript Ajax tutorial, disguised as hacks to fit their form of the book. This is unfortunate because inexperienced readers may choose to use "intermediate" steps of the tutorial as "final" hacks in their applications. We have a bunch of great Ajax libraries; very few people should have to write raw-JavaScript Ajax. That said, it is definitely still worth learning raw JavaScript Ajax. You should always understand one level of abstraction underneath your primary work. Once you've learned, pick a library for your production work.

Chapter 4 ("Power Hacks for Web Developers") is much better -- a grab bag of techniques that will have something new for most readers, even if they have Ajax experience. This chapter also benefits from multiple authors, as you get to see different stylistic choices being made. Also, this chapter encourages more thinking about "what can I do?" instead of just "how can I do it?" There are several examples of mashups that combine existing web services under a single Ajaxy front.

Chapters 5-8 cover a variety of Ajax libraries: DWR, Prototype+Rico, Ruby on Rails, and Scriptaculous. First let me say that I think the choice of which libraries to cover is spot on. The only obvious omission is Dojo, and Dojo is so big and ambitious that a chapter overview in "hacks" format would be useless. And that leads me to the problem: These chapters are not collections of hacks, rather they are introductory chapters that have been wrestled into a "hacks" format. All of these topics have much better coverage online and in other books (which I will be reviewing as this series continues).

The Rails and DWR chapters have particular issues: Chapter 7 (the Rails chapter) is way behind on Rails, claiming coverage of Version 0.9.4. Thomas and Hansson's excellent book Agile Web Development with Rails has a more up to date Ajax chapter, despite having a publish date that is nine months earlier. The DWR hacks (Chapter 5) miss almost everything that is cool about DWR. Hack #48 demonstrates accessing a custom object by having the object store values in a Map and do its own toJSON work. There is no mention of DWR's ability to automatically marshal real-world Java beans, which are typically not backed by Maps. Hack #49 commits the cardinal sin of RPC, doing in multiple roundtrips what could be done in one. This is ironic, since DWR supports a batching operation which automates doing the right thing.

Chapter 8 rocks. Read it. Hacks #68 and #69 demonstrate not one, but two, different ways to "fix" the back button in Ajax applications. #70 adds timeouts to Ajax invocations. #75 and #77 begin to embrace the browser as its own MVC environment, creating client side caches and search indices. This is almost the opposite of what most people think of Ajax -- using the flexibility of JavaScript to reduce communication with servers. Finally, my personal favorite, #73, clearly explains how to use dynamic script tags to cheat the browser security model, letting one page invoke services from multiple domains. (Use with caution, of course.)

In summary: Intermediate to Advanced Ajax developers should read chapters 4 and 8, and beginners should read something else.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有