摘要: Flyweight Pattern,中文可译作享元模式。它的核心是分离对象的:内在属性和外部属性,然后共享内在属性,组装外在属性。看一个汽车的例子:/*Carclass,un-optimized.*/varCar=function(make,model,year,owner,tag,renewDate){this.make=make;this.model=model;this.year=year;this.owner=owner;this.tag=tag;this.renewDate=renewDate;};Car.prototype={getMake:function(){returnt.. 阅读全文