Archive

Archive for the ‘Tech’ Category

InfoQ: Facebook架构师QCon北京2010演讲:扩展Memcached实战

March 1st, 2010

Memcached堪称Facebook的神经系统,虽然其并不复杂,但是如果没有Memcached的话,Facebook繁杂的系统间交互就比较困难。而且,随着Facebook的快速发展,研发团队也不得不改进和扩大Memcached系统。在QCon北京2010大会上,Facebook的架构师Marc Kwiatkowski将分享这一国际领先社交网站的扩展Memcached实战。

via InfoQ: Facebook架构师QCon北京2010演讲:扩展Memcached实战.

admin Tech, 职场

全面提升 Web 2.0 应用程序的性能,第 1 部分: Web 2.0 应用的性能分析概述和新的挑战

February 24th, 2010

由此可见,Web 2.0 的应用给性能工程带来了两大挑战,而这两大挑战恰恰是在传统互联网应用中可以被忽略的性能盲点。在 Web 2.0 应用中它们不能再被忽略:

* 盲点 1:浏览器渲染时间

在传统的互联网应用架构中,绝大多数的工作是在服务器端完成的。所有的业务逻辑是服务器端完成的,并且服务器端生成了完整的 HTML 页面,浏览器只要呈现就可以了。 而在 Web2.0 架构中,很多工作被移到了浏览器端,浏览器用 Javascript 直接操作 DOM 来生成 HTML。而且部分义务逻辑也可以在浏览器端完成。同时,随着异步 HTTP 请求的大量使用,HTTP 请求的发起时间由 JavaScript 逻辑控制。这使得 HTTP 请求的并发度下降,而影响到页面下载的完成时间。这些都使得很多的响应时间消耗在浏览器端。所以浏览器渲染时间不能被忽略。

* 盲点 2:网路传输时间

在传统的互联网应用架构中,逻辑是有 Java 或其他语言在服务器的执行的。这些代码不也就驻留在服务器端而不需要被传输。而在 Web 2.0 架构下,这些代码是很有可能用 Javascript 实现并在 Browser 端执行的。这必然涉及到 Javascript 及其他相关联资源在互联网上的传输。这使 Web 2.0 架构可能会牵涉多的多的 HTTP 请求。而这可能或大大的增加网络传输时间,细节容后再述。

浏览器响应时间= 服务器端响应时间+ 页面装载时间+ 浏览器渲染时间

via 全面提升 Web 2.0 应用程序的性能,第 1 部分: Web 2.0 应用的性能分析概述和新的挑战.

admin Tech

InfoQ: Erich Gamma确定QCon北京演讲:设计模式15年

February 23rd, 2010

Erich Gamma是IBM的杰出工程师,Jazz项目的主要领导者。此前他曾担任Eclipse的Java开发环境JDT项目的领导,目前是Eclipse的项目管理委员会成员,被业界称为“Eclipse之父”。另外,Erich也是经典书籍《设计模式》的作者四人帮之一,他还一直与Kent Beck一起开发JUnit,并编写书籍《为Eclipse做贡献:原则、模式与插件》。

在4月23日~25日举行的QCon全球企业开发大会(北京站)2010上,Erich Gamma将进行题为“设计模式15年——向设计模式2.0迈进”的主题演讲,和与会者分享他在设计模式领域的最新研究成果

InfoQ: Erich Gamma确定QCon北京演讲:设计模式15年.

admin Tech

51 Elliot: Selenium IDE Flow Control – Goto and While Loops

February 21st, 2010

51 Elliot: Selenium IDE Flow Control – Goto and While Loops.

This exension provides goto, gotoIf and while loop functionality in Selenium IDE. Selenium IDE is a plugin for Firefox that automates the testing of web-based applications. There is an excellent flow-controll extension for the Selenium Server and TestRunner components, but it does not work with Selenium IDE (the Firefox plugin) directly. This makes it difficult to develop controlled test cases within Selenium IDE, and there are times when the frame-based TestRunner cannot be used (such as when the website under test employs a frame-buster script).

I’ve ported the existing control-flow extension to work in the Selenium IDE Firefox add-on. The image below shows a sample test case using goto, gotoIf and a while loop, all running successfully in Selenium IDE.


The file linked at the end of this post should be saved as “goto_sel_ide.js” to your hard drive. Then the Options settings in Selenium IDE should set the Selenium Core extensions to include the path of this file, similar to the image below.


Link:

Download goto_sel_ide.js here

Copy & Paste the contents into a new file and save it as “goto_sel_ide.js” in a location such as C:\Documents and Settings\goto_sel_ide.js and configure the Selenium Options tab as shown.  NOTE: please copy and paste the text rather than downloading the file – some people have had formatting issues that prevented the dowloaded file from working. So COPY & PASTE and you should be fine.

Update 26 February, 2006:
This mod of the FlowControl extension works only with the Selenium IDE Firefox add-on. If you want to use the TestRunner component or Selenium RC, please use the original FlowControl extension.

admin Tech

So you want to become an automated tester

February 16th, 2010

Geeks-R-Us: So you want to become an automated tester.

都来做自动化测试开发吧,这是给经验较少的手工测试工程师来看的。

admin Tech, 职场 ,

InfoQ: JSON作者、Yahoo!资深架构师Douglas确认QCon北京2010演讲题目

February 10th, 2010

InfoQ: JSON作者、Yahoo!资深架构师Douglas确认QCon北京2010演讲题目.

这是即将在今年4月23-25日知春路京仪大酒店举行的QCon 2010技术大会中,Browser as a Platform(简称BaaP)主题中会带来分享题目的诸位讲师。这会是此界QCon中非常有亮点的主题,在前端工作日显重要的今天。

————————–

对下届QCon的一点想法:移动开发,尤其是在企业级中的应用,应该会是一个很好的主题。

admin Tech, 随笔

dojo.data.util.simpleFetch

February 8th, 2010

dojo.data.util.simpleFetch.fetch = function(/* Object? */ request){ …… }

这是simpleFetch在dojo site上的文档,格式很糟,http://api.dojotoolkit.org/jsdoc/1.3.2/dojo.data.util.simpleFetch,我分了段贴在这里。

The simpleFetch mixin is designed to serve as a set of function(s) that can be mixed into other datastore implementations to accelerate their development.

The simpleFetch mixin should work well for any datastore that can respond to a _fetchItems() call by returning an array of all the found items that matched the query.

The simpleFetch mixin is not designed to work for datastores that respond to a fetch() call by incrementally loading items, or sequentially loading partial batches of the result set.

For datastores that mixin simpleFetch, simpleFetch implements a fetch method that automatically handles eight of the fetch() arguments — onBegin, onItem, onComplete, onError, start, count, sort and scope.

The class mixing in simpleFetch should not implement fetch(), but should instead implement a _fetchItems() method.

The _fetchItems() method takes three arguments, the keywordArgs object that was passed   to fetch(), a callback function to be called when the result array is available, and an error callback to be called if something goes wrong.

The _fetchItems() method should ignore any keywordArgs parameters for start, count, onBegin, onItem, onComplete, onError, sort, and scope.

The _fetchItems() method needs to correctly handle any other keywordArgs parameters, including the query parameter and any optional parameters (such as includeChildren).

The _fetchItems() method should create an array of result items and pass it to the fetchHandler along with the original request object — or, the _fetchItems() method may, if it wants to, create an new request object with other specifics about the request that are specific to the datastore and pass that as the request object to the handler.

For more information on this specific function, see dojo.data.api.Read.fetch()

dojo.data是个很强大的功能,提供了统一的数据处理接口,以及可用于对8个handler调用的机会:onItem, onBegin, onComplete, onError等等。开发者需要做的就是,自己实现_fetchItems()并在其中调用simpleFetch.fetch中定义的两个handler。在实际使用时,开发者需要调用的仍然是datastore的fetch方法。

admin Tech